in reply to Matching optionally quoted string
I'm perplexed that no one suggested matching the trailing quote mark. This is really rather easy. This is case-insensitive, is friendlier about white-space and matches the beginning single/double quote with the trailing one. It'll break if the HREF attribute is anywhere except at the beginning of your REF tags.
while ( <ASX> ) { next unless m(<REF\s+HREF\s*=\s*(['"])(.+?)\1)si; print PLAYLIST $2, "\n\n"; }
|
|---|