javascript - Regex to return single attribute from string -


using javascript, can please me pattern match in string:

div style="display: none" key="abc\jones" displaytext="tom jones" 

my goal extract value key, in case: abc\jones

so, between

key=" 

and

" 

thanks help!!

something like:

/ key="([^"]*)"/ 

should match

the tailing " completeness matches key="..." , not key="...

as how working, normal characters them selves, [^"] defines match group of characters not " ( ^ being not ). match after key=" until collides ". ( ) capture matched values later recall.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -