Can someone help me find a suitable regular expression for checking a line with comma numbers, for example. '1,2,3'or '111,234234,-09'etc. Everything else should be considered invalid. eg. '121as23'or '123-123'is invalid.
I assume this should be possible in Flex using a regular expression, but I cannot find the correct regular expression.
@Justin, I tried your suggestion /(?=^)(?:[,^]([-+]?(?:\d*\.)?\d+))*$/, but I ran into two problems:
- This will lead to invalidity
'123,12', which must be true. - This will not result in invalidation
'123,123,aasd', which is invalid.
I tried another regex - [0-9]+(,[0-9]+)*which works quite well, except for one problem: it checks '12,12asd'. I need something that will only allow numbers separated by commas.
source
share