Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regexp question...replacing a url variable 1

Status
Not open for further replies.
Here's the pattern to find "orange=any number" within a larger string.

/orange=\d{1,}/



[monkey][snake] <.
 
I don't know what you want to replace it with, here is a small example:

Code:
var thisUrl = "[URL unfurl="true"]http://www.site.com?apple=12&orange=342";[/URL]
alert(thisUrl.replace(/orange=\d{1,}/, "orange=69"));
thisUrl = thisUrl.replace(/orange=\d{1,}/, "orange=69");


[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top