[Tutor] regexp help

Botykai Zsolt zsolt.botykai at online.hu
Thu Sep 23 16:25:47 CEST 2004


csütörtök 23 szeptember 2004 16:14 dátummal Kent Johnson ezt írta:
> The code you have will read all input from stdin and process it at once.
> The regex will match everything from the first --==--==--==--==-- to the
> last, even spanning many lines. Is that what you want?

yes. these are not so big text file, with contents like this:

<some useless row>
<delimiter>
<some useful rows or empty lines (where empty lines contains only \n or spaces 
and/or tabs + \n>
<some useful rows>
<some useful rows or empty lines (where empty lines contains only \n or spaces 
and/or tabs + \n>
<some useful rows>
<some useful rows or empty lines (where empty lines contains only \n or spaces 
and/or tabs + \n>
<delimiter>
<useless rows>

AFAIK the first solution is to handle STDIN in a cycle and print process like 
you suggested, but I wanted to resolve this with regexp and without cycles.
So you are right, I wanted to match all the lines between --==--==--==--==--s 
except the above defined empty lines.

Zsoltik@


--------------------------------------------------------------------------

Opinions, conclusions and other information in this message that do not
relate to the official business of Online Business Technologies Corp.
shall be understood as neither given nor endorsed by it. In such cases
Online Business Technologies Corp. will not bear the responsibility of
consequences.
If you have received this communication in error, please notify the
system manager immediately by responding to this email and then delete
it from your system.


A levelben foglalt, nem az Online Rt. hivatalos uzletmenetevel kapcsolatos
velemenyek vagy mas informaciok vonatkozasaban az Online Rt. nem vallal
felelosseget.
Amennyiben a level valamely hiba folytan jutott Onhoz, kerjuk, hogy
valaszlevelben azonnal ertesitse a rendszer uzemeltetojet, majd torolje ki
a levelet rendszerebol!



More information about the Tutor mailing list