RexEx Recipes – No Special Characters

By XeroCube | February 26, 2011

I am not a RegEx (regular expressions) guru. In fact, these mystical formulas are rather foreboding and I consider them a black art. To those that are wizards, though, they can wield powerful results.

For my needs, I needed to prevent certain special characters from my text entry fields. I knew a RegEx validator would be useful, I just didn’t know the correct formatting. As luck would have it, as evidenced by a quick Google search, there were many to choose from.

This particular formula suited my needs perfectly.

[^<>/?&{};#]+

You can read more about this expression here: http://regexlib.com/REDetails.aspx?regexp_id=2126

Thanks, www.regexlib.com!

Topics: Code, Tech | No Comments »

Comments

Archives

Blogroll

RockinMedia