0

I am trying to implement some of my old notepad++ regex search in perl.

I using following command.

perl -i -pe 'BEGIN{undef $/;} s/\\cellx10464\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f4\\fs20\\b\\cf0 Patent Information\\b0(?:.*[\r\n]+){88}\\cellx10464\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f1\\fs20\\cf0 \\f1\\fs20\\cf0 US \d{11}(?:.*[\r\n]+){52}\\cellx10464\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f1\\fs20\\cf0 \\f1\\fs20\\cf0 (US [0-9]{5,7})[\r\n]+\\cell\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f1\\fs20\\cf0 \\f1\\fs20\\cf0 (\w\d)[\r\n]+\\cell\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f1\\fs20\\cf0 [a-zA-Z]{3} [0-9,]{3} [0-9]{4}[\r\n]+\\cell\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\sl320\\plain\\f1\\fs20\\cf0 \\f1\\fs20\\cf0  [\r\n]+\\cell\\pard\\plain\\intbl\\s0\\ql\\fi0\\li0\\ri0\\plain/tttttt$1 $2/smg' 1.rtf

Edit but it is giving error.(after changing from suggestions)

Can't find string terminator "'" anywhere before EOF at -e line 1.

This is my first encounter with perl. What am I missing (or adding)?

Using strawberry perl for windows.

2
  • I think problem is with (?:.*[\r\n]+){88} Dec 11, 2015 at 9:57
  • \1 and \2 are called $1 and $2 in the replacement part.
    – choroba
    Dec 11, 2015 at 10:05

1 Answer 1

0

Apology for the trouble. This already has answer here https://stackoverflow.com/questions/20712181/strawberry-perl-regex-windows-7

use of " instead of ' in windows.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .