1

I read regex documentation but don't understand how to that i want.

i have urle http://testhermes.tumblr.com/post/108728110699/hermes-instagram-photo-sit-back-and-relax?index=1 like this wit regex i want take numbers after post "108728110699" and index= "1"

can you help me please. thank you.

Aram Mkrtchyan
  • 2,690
  • 4
  • 31
  • 47

1 Answers1

1

var url = "http://testhermes.tumblr.com/post/108728110699/hermes-instagram-photo-sit-back-and-relax?index=1";
url = url.match(/\d+/g);
alert(url[0]);  //108728110699
alert(url[1]); //1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Sadikhasan
  • 18,365
  • 21
  • 80
  • 122