A <a> tag is not supposed to hold any other <a> tag, so a simple ungreedy regexp would do the trick (i.e. string.match(/<a>(.*?)<\/a>/)
, but this example suppose the tags have no attribute).
↧
Answer by Pik' for What's the best way to strip out only the anchor HTML tags in javascript, given a string of html?
↧