[Boulder.pm] Perl Help

Rob Nagler nagler at bivio.biz
Mon Apr 2 07:19:19 PDT 2007


Everybody else's solutions arew fine.  However, this is the perl list
and there's more than one way...

I think the following might be clearer:

perl -pe 's/(?=(?:C|D|I|II);)/ /' infile > outfile

It demonstrates some of the more powerful regexp features which only
perl seems to have.  The regexp assertions (?=) are quite powerful.
In this example, they allow me to list the different part # suffixes
easily so a non-perl programmer could easily modify this program, I
think.

Rob

PS. Also posted on pikes-peak-pm.


More information about the Boulder-pm mailing list