Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: regex expression helpby Trix606 (Monk) |
on Nov 08, 2005 at 17:42 UTC ( [id://506816]=note: print w/replies, xml ) | Need Help?? |
I am not quite sure from your question whether you are having a problem with the match itself, or simply are asking about printing what precedes the match. As for the match I tried your code and sample data and it works, ( once you add a semi-colon after Found it\n"). You can print the contents of $` to get what precedes your match. Check out perldoc perlvar for info on $` and other variables you can use with a regex and more.
In Section
Seekers of Perl Wisdom
|
|