If you want to grab an arbitrary amount of text around something for which you are searching, just specify it in the regex. If you want the leading and trailing, say, 100 characters...
/(.{0,100}$key.{0,100})/
Afterwards, because of the parens, your match will be in the variable $1.
In reply to Re: Files! Reading specific parts
by skyknight
in thread Files! Reading specific parts
by wizard341
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |