Regex - Matching two numbers before a certain string -
how match 2 numbers before word "min"
sample string:
15min
i want match:
15
edit:
i've tried matching pattern, how 2 characters before?
\w*((?i)min(?-i))\w*
here's regex extracts first number in string:
^\d*(\d+).*$
if number must in front of min, can write as:
^\d*(\d+)min.*$
Comments
Post a Comment