How would I match the two numbers before the word "min"
Sample string:
15min
I would want to match:
15
Edit:
I've tried matching the pattern, but how do I get the two characters before?
\W*((?i)min(?-i))\W*
How would I match the two numbers before the word "min"
Sample string:
15min
I would want to match:
15
Edit:
I've tried matching the pattern, but how do I get the two characters before?
\W*((?i)min(?-i))\W*
Here's a regex that just extracts the first number in the string:
^\D*(\d+).*$
If the number must be in front of min, then you can write it as:
^\D*(\d+)min.*$