Regex start matching from last occurence -


i have html code:

<a href="localhost/1153,test">  <img src="test.jpg"> (...) <a href="localhost/1191,test8">  <img src="test2.jpg"> (...) <a href="localhost/9838,test">  <img src="13.gif"> (...) 

want match value before gif, in example 9838. no matter how try, end first match (1153). how match "backwards" known pattern?

\d*(?=,.*\.gif) 

this matches first occurence of digits before

[comma][other text][.gif] 

you can test here.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -