Regular expression which allows all characters except for "<>_ ;{}[]"

Jabir

I need a regular expression in javascript which allows all characters except for following characters <>_ ;{}[]

Following is the regular expression which i have tried this[regex] checks for allowed characters.

"^[A-Za-z0-9\s~!@#$%^&amp;*()|\&quot;\':?\/.+=,.-]*$"

but it is failing for following string ~!@#$%^&*()|\"':?/.,ab-=12+

Amit Joki

Why not use a negated class instead of putting all of them in a character class? It's easier to read and faster in execution.

/^[^<>_ ;{}\[\]]+$/

Just use RegExp.test with the above regex.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Regular Expression to replace all non alphanumeric characters except / to empty("") character

From Dev

Regular expression accepts all special characters except space

From Dev

Regular expression to select all characters except letters or digits

From Dev

how to have regular expression for a textfield which accepts all characters except a comma (,) and do not accept a white space at both ends

From Dev

Regular expression for anything except ']]' characters

From Dev

Regular Expression allows more than specified characters

From Dev

Regular expression which allows alphabets, dashes(-) and dot(.)

From Dev

regular expression which allows square brackets

From Dev

Regular expression in Javascript for a string which have ONLY numbers & should not have any characters at any position except numbers

From Dev

Regular expression match all except first occurence

From Dev

Java regular expression find all A except B

From Dev

Regular expression which allows numbers, spaces, plus sign, hyphen and brackets

From Dev

Mobilenumber validation in Regular Expression which allows + at beginning only

From Dev

In a regular expression, which characters need escaping?

From Dev

Regular Expression for Password strength with one special characters except Underscore

From Dev

Regular Expression: Replace except from specific characters and whitespace

From Dev

javascript regular expression to recognize all special characters

From Dev

A regular expression which covers all symbols?

From Dev

Regular Expression for everything except all spaces and one special character

From Dev

regular expression to match all java imports except one with a certain ending

From Dev

Regular expression to remove all punctuation except commas in regex awk

From Dev

regular expression which should allow limited special characters

From Dev

Regular expression of validating text which contains certain special characters on condition

From Dev

C# regular Expression that allows only alphabets and numbers but not any special characters or spaces

From Dev

Java Regular expression for special characters across all languages

From Dev

Regular expression to return all characters between two strings

From Dev

Select all email addresses beginning with 5 numeric characters (regular expression)

From Dev

Regular expression matching all characters including carriage return

From Dev

Regular Expression to accept all Thai characters and English letters in python

Related Related

  1. 1

    Regular Expression to replace all non alphanumeric characters except / to empty("") character

  2. 2

    Regular expression accepts all special characters except space

  3. 3

    Regular expression to select all characters except letters or digits

  4. 4

    how to have regular expression for a textfield which accepts all characters except a comma (,) and do not accept a white space at both ends

  5. 5

    Regular expression for anything except ']]' characters

  6. 6

    Regular Expression allows more than specified characters

  7. 7

    Regular expression which allows alphabets, dashes(-) and dot(.)

  8. 8

    regular expression which allows square brackets

  9. 9

    Regular expression in Javascript for a string which have ONLY numbers & should not have any characters at any position except numbers

  10. 10

    Regular expression match all except first occurence

  11. 11

    Java regular expression find all A except B

  12. 12

    Regular expression which allows numbers, spaces, plus sign, hyphen and brackets

  13. 13

    Mobilenumber validation in Regular Expression which allows + at beginning only

  14. 14

    In a regular expression, which characters need escaping?

  15. 15

    Regular Expression for Password strength with one special characters except Underscore

  16. 16

    Regular Expression: Replace except from specific characters and whitespace

  17. 17

    javascript regular expression to recognize all special characters

  18. 18

    A regular expression which covers all symbols?

  19. 19

    Regular Expression for everything except all spaces and one special character

  20. 20

    regular expression to match all java imports except one with a certain ending

  21. 21

    Regular expression to remove all punctuation except commas in regex awk

  22. 22

    regular expression which should allow limited special characters

  23. 23

    Regular expression of validating text which contains certain special characters on condition

  24. 24

    C# regular Expression that allows only alphabets and numbers but not any special characters or spaces

  25. 25

    Java Regular expression for special characters across all languages

  26. 26

    Regular expression to return all characters between two strings

  27. 27

    Select all email addresses beginning with 5 numeric characters (regular expression)

  28. 28

    Regular expression matching all characters including carriage return

  29. 29

    Regular Expression to accept all Thai characters and English letters in python

HotTag

Archive