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 reply to Re: regex expression help
by Trix606
in thread regex expression help
by JFarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |