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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -