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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -