How to match end-of-line multiple times in a regex without interpolation

Posted by harschware on Stack Overflow See other posts from Stack Overflow or by harschware
Published on 2010-05-20T18:08:22Z Indexed on 2010/05/20 18:10 UTC
Read the original article Hit count: 252

Filed under:
|
|

Hi, if I have a input with new lines in it like:

[INFO]
xyz
[INFO]

How can I pull out the xyz part. I tried a pattern like /^\[INFO\]$(.*?)$\[INFO\]/ms, but perl gives me:

Use of uninitialized value $\ in regexp compilation at scripts\t.pl line 6.

I've been trying things to get interpolation to stop like using qr// but alas, no love.

© Stack Overflow or respective owner

Related posts about perl

Related posts about regex