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)
(?=cm)
positive lookahead asserts match must followed cm
Comments
Post a Comment