in reply to Re^2: Split with numbers
in thread Split with numbers
Nice. Though rather than pre-declaring @out and then pushing to it, I'd use map to initialise @out directly:
@out = map[ m[([A-Z]*)([0-9]*)([A-Z]*)] ], qw[ AB23C ABC23 23BC ABC ]; +; pp \@out;; [ ["AB", 23, "C"], ["ABC", 23, ""], ["", 23, "BC"], ["ABC", "", ""], ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Split with numbers
by muba (Priest) on Nov 24, 2015 at 20:54 UTC |