First, split the string whereever there is a letter followed by a space or comma followed by a digit or the other way round, then eliminate all remaining spaces. The array @x will contain the strings an digits.@x = map {tr/ //d;$_} split /(?<=[[:alpha:]])[\s,]+(?=\d)|(?<=\d)[\s,] ++(?=[[:alpha:]])/, $string;
pike
In reply to Re: Regex Question
by pike
in thread Regex Question
by TacoVendor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |