in reply to Files! Reading specific parts
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Files! Reading specific parts
by wizard341 (Acolyte) on Jul 29, 2003 at 18:49 UTC | |
by skyknight (Hermit) on Jul 29, 2003 at 19:01 UTC |