i trying use jquery regex validation textbox should allow alphabetic letters, numbers , should not allow specific special characters <>'";:.
based on previous questions, used /^[a-z0-9/.\#!%&~ -]+$/i allowed these mentioned special characters.
i admit might seem duplicate question, unfortunately did not find examples special characters should not allowed. please me out this.
in order not allow specific set of symbols, need negated character class formed of square brackets ^ symbol right after opening square bracket.
^[^<>'";:]+$ this regex allow characters other ones specified in character class. note -, ] , [ should either @ start or end of character class, or have escape them.
see more details character classes on regular-expressions.info.
Comments
Post a Comment