regex - regular expression in matlab to match decimal in filename -


i'm trying match int or decimal in matlab using regular expressions

i have: kabel_2.5cm_proef2.xls , want match 2.5

another example: kabel_5cm_proef1.xls want match 5

any ideas?

to match int or floating point numbers present before string cm

\d+(?:\.\d+)?(?=cm) 

demo

(?=cm) positive lookahead asserts match must followed cm


Comments

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -