more useful options | |
PerlMonks |
Re^2: Complex regex questionby rsFalse (Chaplain) |
on Sep 25, 2019 at 18:52 UTC ( [id://11106695]=note: print w/replies, xml ) | Need Help?? |
One more variant:
It generates triplets with one undefined value ($1 or $3), but you can grep defined values as AnomalousMonk mensioned. EDIT: Sorry for mistake. I changed condition "2 == grep defined, $1, $3" to "1 != grep defined, $1, $3", because one of $1 or $3 must be defined. ADDED: Similar approach using conditional. It captures in same way. ADDED-2: Also:
In Section
Seekers of Perl Wisdom
|
|