80 views (last 30 days)
Walter Roberson on 4 Apr 2012
regexp(string, '(\d+,)*\d+(\.\d*)?', 'match')
The above is flexible enough to support any number of leading groups of digits and commas (including no leading groups). It is also flexible enough to support the possibility that the decimal point and following digits are not present -- so it supports the equivalent of your \d+ (plain integers without commas or decimal points). Furthermore it supports a trailing decimal point with no digits afterwards.