» Archive for the 'javascript' Category

jQuery Detector Overkill

Wednesday, July 30th, 2008 by pyrolupus

With the ideas, help, and suggestions of some very smart folks, I’ve been able to put together a userscript that displays whether jQuery is used on the current page—along with version—and can also load jQuery into the current page by clicking the indicator if jQuery is not already present.
Read the rest of this entry »

Email Validation RegExp

Friday, November 2nd, 2007 by pyrolupus

I had to search my desktop files and email history for forty minutes before I turned this up:

var rfc2822 =
/^[\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])*)+\.(?:[a-z]{2,4}|museum|travel)$/i;


That’s a JavaScript variable declaration, but the RegExp is valid for Perl and can be quickly translated for other languages.