JoshuaD has asked for the wisdom of the Perl Monks concerning the following question:
Is there anyway to get rid of that temporary value $address? I've tried:while(<ASX>) { next unless m{<REF HREF=(.*)/>}; $address = $1; $address =~ s/\"//g; print PLAYLIST $address, "\n\n"; }
which doesn't work because * is greedy, so I tried:next unless m{<REF HREF=\"?(.*)\"?/>};
Which should work, considering *? is lazy, and ? is greedy, but it still doesn't. Can on of you monks shed some light on this?next unless m{<REF HREF=\"?(.*?)\"?/>};
But i'm not sure if it will always have quotes in it.<REF HREF="mms://<some_address>.(wma|wmv|maybeSomethingElse)" />
janitored by ybiC: Retitle from less-than-descriptive "Regex Question"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching optionally quoted string
by etcshadow (Priest) on Dec 14, 2003 at 16:48 UTC | |
|
Re: Matching optionally quoted string
by diotalevi (Canon) on Dec 14, 2003 at 19:30 UTC | |
|
Re: Matching optionally quoted string
by mirod (Canon) on Dec 14, 2003 at 17:03 UTC | |
by CountZero (Bishop) on Dec 14, 2003 at 18:06 UTC | |
|
Re: Matching optionally quoted string
by CountZero (Bishop) on Dec 14, 2003 at 18:05 UTC | |
by ysth (Canon) on Dec 14, 2003 at 18:29 UTC | |
by ysth (Canon) on Dec 14, 2003 at 18:43 UTC | |
|
Re: Matching optionally quoted string
by delirium (Chaplain) on Dec 15, 2003 at 00:11 UTC | |
|
Re: Matching optionally quoted string
by bl0rf (Pilgrim) on Dec 14, 2003 at 21:45 UTC | |
|
Re: Matching optionally quoted string
by Aristotle (Chancellor) on Dec 15, 2003 at 03:59 UTC |