Hey all;
I'm trying to wrap all occurrences of an IP address with an HREF so I can then Do Stuff(tm).
I've run the regex itself through several validators, and it matches pattern as expected. Therefore, I'm thinking my problem is in the implementation, but I can't see the correct path. Can anyone help out?
Here's the regex and relevant code:
var theIps = new RegExp('^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$','g');
var newBody = jQuery('#ELEMENT').html();
var processed = newBody.replace(theIps, '<a class="ipPopup" href="javascript:void(0)" rel="10.5.1.2" onclick="addToWatchlist(this)">TESTING REGEX</a>');
jQuery('#ELEMENT').html(processed);
Thanks in advance for any assistance...