javascript - Regex to find pattern, return subpattern -


 var s = "lala url(ok) tee hee url( oh ya ) kk";  s.match( /url(([^)]+))/g ); 

from 's' trying extract:

 ['ok', ' oh ya '] 

but, getting:

 ["url(ok", "url( oh ya "] 

i can iterate on list , remove 'url(', suspect regex-fu can remove too.

in other language regex support lookbehind using regex (?<=url\()(([^)]+))

but unfortunately javascript regex doesn't support lookbehind this example, must iterate it. except don't realy need url word included.


Comments

Popular posts from this blog

Admob integration with pygame in android -

mod rewrite - Using "?" when rewriting the URL -

installer - what is Hex representation of MSIUSEREALADMINDETECTION? -