With the following expression (,) ([0-9] *) can get 25, but I would like to get only 25.
decimal (10.25)
In this case how do I disregard ,
With the following expression (,) ([0-9] *) can get 25, but I would like to get only 25.
decimal (10.25)
In this case how do I disregard ,
If you just want to leave the number in a capture group, just take the comma from the parentheses:
,([0-9]*)
To ensure that you have some number you can use +
instead of *
(you can use \d
instead of [0-9]
if you want):
,(\d+)
Use the following regular expression that will work:
(?<=,)([0-9]+)
This regular expression uses lookbehind
that nothing else is to find the values of the set group ([0-9]+)
if before it find the comma (?<=,)
.
A full explanation of lookahead
and lookbehind
can be found on this site .
Here is a code example with Python:
import re
m = re.search('(?<=,)([0-9]+)', '(0,25)')
print m.group(0) #25