C++ regex for string "M0.89" -


trying represent following in c++ regex: m0.89 or m1.78 or m0.9

"m|m([0-9].[0-9]+)" 

regex checking programs show not working. doing wrong?

thank you!

the problem way using alternation operator. on left side (1st alternative), it's looking match letter "m" literally. on right side (2nd alternative), it's looking "m" followed numeric character → single character , numeric character.

any easy way use character class here:

"[mm][0-9]\\.[0-9]+" 

note: match literal ., need precede double backslashes.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -