I am trying to write a regex to get the numbers from strings like these ones:
javascript:ShowPage(\'6009\',null,null,null,null,null,null,null)
javascript:Bloc
Assuming:
Try this:
/(\d+)/
then $1
(Perl) or $matches[1]
(PHP) or whatever your poison of choice is, should contain the digits.
Try this:
(\d+)
What language are you using to parse these strings?
If you let me know I can help you with the code you would need to use this regular expression.
just match numbers: \d+
// PHP
$string = 'ssss 12.2';
$pattern = '/\D*(\d+)(.|,)?(\d+)?\D*/';
$replacement = '$1.$3';
$res = (float)preg_replace($pattern, $replacement, $string);
// output 12.2
Integer or float:
/\d+((.|,)\d+)?/