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

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -