regex - How to get the second occurrence of a Regexp match in Javascript -


i want 2 string following url, first -43.575285, second 172.762549

http://maps.apple.com/?lsp=9902&sll=-43.575285,172.762549

i wrote regexp pattern re = /-?\d+\.\d{6}/;

which works first value, there way matcher can continue search result string , give me second pattern occurrence?

p.s remember ruby has $1-$9 reference occurrence.

add g flag end...

re = /-?\d+\.\d{6}/g; 

this g global.

var matches = str.match(re); 

note won't work quite above if add capturing groups.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -