in reply to Two Regex Searches Simultaneously (on One Line)
Regular expressions are great for handling complex string manipulations, but in this case, I would say you are taking a string of numbers separated by spaces, and dividing on the spaces. split() seems a more natural mechanism:
my @a = split ' ', $s1; my @b = split ' ', $s2;
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Two Regex Searches Simultaneously (on One Line)
by Monkomatic (Sexton) on Oct 24, 2010 at 14:45 UTC |