regex - Regexp for a +ve (or -ve) fraction number in Tcl -
i trying figure out regexp expression getting
40 in
optical power = 40 dbm
and -5.5 in
optical power = -5.5 dbm
i used (\+|-?[0-9]+\.[0-9]+)
. wont work first case.
you may try this,
[+-]?[0-9]+(?:\.[0-9]+)?
[+-]?
matches optional plus or minus character.
Comments
Post a Comment