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

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -