in reply to Can I start a regular expression half way through a string
And so on. The nice thing is you can contain the end of the match as well as where to start.substr($foo,5)=~/HLAG/; # Only beyond the 5th char substr($foo,10,100)=~s/narf/poit/g;
Afterthought: This bind-operator trick can also be used with reverse for nonsense like:
But this doesn't work with s///, of course.(reverse $foo)=~/dlroW/;
|
|---|