actionscript 3 - CSV regex with any digit -
i trying looking regex allows comma separated values. this.
23,23,23233-2-3,23,2323/23/2333,22-22-2222,23
i have tried couple of things nothing fits 100%.
[^,;]+/(?!,)(?:(?:,|^)([-+]?(?:\d*\.)?\d+))*$/(\d+, ?)+(\d+)?
my use case , if string pass through above regex, parse values , store array. if string doesn't have single , leave string.
thanks
as stated in comments, have come following solution:
(?m)^(?:\d+[\/,-]){2,}\d+$ explanation:
(?m): make^,$match start , end of line respectively.^: start of line(?:: ignore group\d+: match digit 1 or more times[\/,-]: followed/or,or-
): closing parenthesis ignore group{2,}: match 2 times or more\d+: match digit 1 or more times$: end of line
Comments
Post a Comment