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

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -