in reply to Quick regex
Like this?
$s = 'fred_bill_john_jack_joe_mary_eugene';; $s =~ /(^[^_]+_[^_]+_[^_]+_)/ and print "'$1'";; 'fred_bill_john_'
Or this?
$s =~ /(^(?:[^_]+_){3})/ and print "'$1'";; 'fred_bill_john_'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quick regex
by Karger78 (Beadle) on Nov 24, 2009 at 17:34 UTC | |
by ikegami (Patriarch) on Nov 24, 2009 at 18:00 UTC | |
by Anonymous Monk on Nov 24, 2009 at 17:41 UTC |