or# untested for(@str) { /^(?:(\w{2}_[a-z0-9]+)|([a-z0-9]+)_)/i and print $1 || $2, "\n"; }
for(@str) { /^(\w{2}_[a-z\d]+|[a-z\d]+(?=_))/i and print $1, $/; }
In reply to Re: Regular Expression - pattern matching
by borisz
in thread Regular Expression - pattern matching
by kulls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |