Regular expression, picking up numbers before a text

3

I wanted a regular expression to pick up 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 all the numbers?

    
asked by anonymous 01.09.2015 / 19:57

1 answer

3

If you join a + after \d already works. In this way it means a number that occurs one or more times . Being without + means only once .

\d+(?= min)

Example: link

    
01.09.2015 / 20:12