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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -