in reply to Re: Faced with Null/blank/empty value
in thread Faced with Null/blank/empty value
Good idea - especially if it is in a loop. Instead of all three regexes every time, it'll do a maximum of 3.
In order to get the same results, however, the three regexes need to be reversed. In bh_perl's example, when the first match and the last match succeeded, $1 and $2 are set in the third match. In your example, if the first match succeeds the third is never evaluated so $1 and $2 are set by the first match. Reverse the three matches and the results will match the OP's.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Faced with Null/blank/empty value
by cLive ;-) (Prior) on Jul 22, 2003 at 09:07 UTC | |
by jsprat (Curate) on Jul 22, 2003 at 09:45 UTC |
In Section
Seekers of Perl Wisdom