3
I wanted a regular expression to catch the minutes in a string with this format:
1 min
10 min
I made that expression. \d(?= min)
The problem is that it only takes the last number, the closest to the min. How would I get the all numbers?
3
I wanted a regular expression to catch the minutes in a string with this format:
1 min
10 min
I made that expression. \d(?= min)
The problem is that it only takes the last number, the closest to the min. How would I get the all numbers?
3
If you put a +
after \d
already works. That way you mean a number that occurs once or more. Being without the +
means only once.
\d+(?= min)
Example: http://regexr.com/3bmpn
Browser other questions tagged regex
You are not signed in. Login or sign up in order to post.
And if you put one together
+
after\d
? -> http://regexr.com/3bmpn– Sergio
Resolve, put as answer I mark there :) Thanks!
– Ricardo