in reply to Regex Question
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
|
|---|