Reputation: 32143
I'm using the following on my site:
$('body').html($('body').html().replace(>> ?(\d+)/g, '<b>$&</b>'));
(I'm using jQuery)
The Regular Expression I'm using is >> ?(\d+)/g
. The Bold below shows what it should be replacing:
This passage of text >> 124949200 contains two slightly >>20993910 different regular expressions.
Now, I've used this tool here: http://regexpal.com/ and my RegEx works fine. When I actually implement it, however, it doesn't work.
Any ideas?
Upvotes: 0
Views: 83
Reputation: 16419
JQuery's html()
function appears to be outputting the >>
as encoded characters: >>
. Simply change your regular expression to this:
$('body').html($('body').html().replace(/>> ?(\d+)/g, '<b>$&</b>'));
Upvotes: 1