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
Post a Comment