sergio has asked for the wisdom of the Perl Monks concerning the following question:
For example one can do something like
while ( my ($m) = ($string =~ /<regex>/g) ) { <do something with $m> }
And a sequence of matches can be processed.
But can a similar pattern be applied to an input stream? Specially in the case where the match can overlap over several lines. That is the match operator would read the stream till something matches.
The advantage: no need to read the file in large chunks or completely.
The use: parsing large ammounts of multiline stuff.
Thank you for any wisdom!
Sergio
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexing an input stream...
by dws (Chancellor) on Jun 18, 2003 at 18:33 UTC | |
|
Re: Regexing an input stream...
by particle (Vicar) on Jun 18, 2003 at 18:47 UTC | |
by shotgunefx (Parson) on Jun 19, 2003 at 11:20 UTC | |
by PodMaster (Abbot) on Jun 19, 2003 at 11:35 UTC | |
by shotgunefx (Parson) on Jun 19, 2003 at 11:42 UTC | |
|
Re: Regexing an input stream...
by BrowserUk (Patriarch) on Jun 18, 2003 at 19:04 UTC | |
by sergio (Beadle) on Jun 18, 2003 at 21:57 UTC | |
|
Re: Regexing an input stream...
by nekron99_ (Acolyte) on Jun 18, 2003 at 21:48 UTC | |
by sergio (Beadle) on Jun 18, 2003 at 21:54 UTC | |
by aquarium (Curate) on Jun 19, 2003 at 01:26 UTC | |
by sergio (Beadle) on Jun 19, 2003 at 13:49 UTC | |
|
Re: Regexing an input stream...
by Anonymous Monk on Jun 19, 2003 at 15:26 UTC | |
|
Re: Regexing an input stream... (tye)
by tye (Sage) on Jun 19, 2003 at 22:13 UTC |