Regexps are designed for pattern matching in text, and are not suited to numeric calculations. Even though some languages allow you to embed code inside a regexp, this wouldn't be a good idea in this case IMO as it would be ugly, confusing and overkill anyway (since the amount of pattern matching is negligible).

I don't know what language you're programming in, but if this was me (working in Perl with no extra modules), I'd just do:

If your string is a comma-separated list, I wouldn't use regex for this at all. Perl, python, php, and probably C# all have the "explode" function, which turns a delimited list into an array. Couple that with a built-in MAX function (which PHP has, but maybe not the others) and you get your highest number.