How do you “debug” a regular expression with sed?

后端 未结 8 1583
日久生厌
日久生厌 2021-01-31 08:19

I\'m trying to use a regexp using sed. I\'ve tested my regex with kiki, a gnome application to test regexpd, and it works in kiki.

date: 2010-10-29          


        
8条回答
  •  长发绾君心
    2021-01-31 09:13

    That looks more like a perl regex than it does a sed regex. Perhaps you would prefer using

    perl -pi.orig -e 's/author:\s[0-9]{11};//g' file1 file2 file3
    

    At least that way you could always add -Mre=debug to debug the regex.

提交回复
热议问题