SPUG: Regex multi-line question

Richard Wood wildwood_players at yahoo.com
Tue Aug 3 11:57:31 CDT 2004


I am always impressed at the demonstrations of regex's
that are shown at SPUG.  

I have been trying to figure out a one liner that will
parse out multiple sets of patterns from an xml file.

I can do it easily enough with a while<> loop (or a
parser) but I figure there is a more obfuscated
solution that one of you can propose using one line.

I am looking for a result something like:

Record, /home/woody/vinyl/Migration, JB_Migration.tar
CD, /home/woody/cd/Migration, JB_Migration.tar
TAPE, /home/woody/cass/Migration, JB_Migration.tar

>From the following file.

Don't ask/recommend that I use a parser, that isn't
the objective.  Think of it as more a perl golf

<?xml version="1.0" encoding="UTF-8" ?>
<media type="Record">
<media type="CD">
<media type="TAPE">


Rich Wood

Richard O. Wood
Wildwood IT Consultants, Inc.
wildwood_players at yahoo.com
425.281.1914 mobile
206.544.9885 desk

Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

More information about the spug-list mailing list