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

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - JavaScript + Thymeleaf - select onchange -

node.js - Using Node without global install -