Is it possible to match \"the dog is really really fat\" in \"The dog is really really fat!\" and add \"
If you use jQuery, you can use the text property on the element containing the text you're searching for. Given this markup:
The dog is really really fat!
This would yield "The dog is really really fat!":
$('#the-text').text();
You could do your regex search on that text instead of trying to do so in the markup.
Without jQuery, I'm unsure of an easy way to extract and concatenate the text nodes from all child elements.