asp.net - Replace in-string characters with regex in javascript -


i'm pretty unconfident regex , need simple work: have input string this:

<a id="randomid">some text ( +1 more text)</a> 

now need replace "1", know between ( + , space, how can regex?

that string generated asp.net inside asp:hyperlink component, first try generate number inside <span> know id, looks asp.net remove html tags inside asp component

assuming you're using jquery...

$('a#randomid').text().replace(/(.+ \( \+)([0-9]+)(.+)/, "$12$3") 

will give you...

some text ( +2 more text) 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -