"Rob" <reply_@news_group.please> wrote in message news:<S1******************@amsnews05.chello.com>.. .
"Andrew Urquhart" <re***@website.in.sig> schreef in bericht
news:Gh***************@newsfe2-gui.server.ntli.net... Rob wrote: Hello all,
I have the folowing string
"url(http://www.somelocation/anaywhere/image.jpg)" stored in the
variable str_image
and I want to extract the string between the brackets.
I have
ar_match=str_image.match("url([.]*)");
I'd do:
var strURI = str_image.replace(/^url\(|\)$/ig, "$1");
--
Andrew Urquhart
- FAQ: http://jibbering.com/faq
- Archive: http://groups.google.com/groups?grou...ang.javascript
- Reply: www.andrewu.co.uk/about/contact/
From now on I do the same ... ;-)
thanks Rob
Note that the "$1" is extraneous in the replacement string, since
there are no capturing parentheses in the RegExp literal (not that any
are desired in this case).
The slight modification:
var strURI = str_image.replace(/^url\(|\)$/ig, "");
seems likely to be as Andrew intended to present.