No such thing as a small change | |
PerlMonks |
Re: regular expression for getting text between 1. and 2.by si_lence (Deacon) |
on Apr 12, 2013 at 14:33 UTC ( [id://1028383]=note: print w/replies, xml ) | Need Help?? |
I see two options:
Either use anchors /^1[).](.*?)2[).]$/ or use a greedy match /1[).](.*)2[).]/ btw. In the character class you don't need the pipe for an or. Your regex would also match 1| some text 2| hope this helps
In Section
Seekers of Perl Wisdom
|
|