Is it possible to match \"the dog is really really fat\" in \"The dog is really really fat!\" and add \"
The dog is really really fat!
Naah... just use the good old RegExp ;)
var htmlString = "The dog is really really fat!"; var regexp = /<\/?\w+((\s+\w+(\s*=\s*(?:\".*?"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/gi; var result = '' + htmlString.replace(regexp, '') + '';