Regex for non-alphabets and numbers

Please provide a solution for writing a regular expression as shown in C # .NET: I would require RegEx for non-alphabets (z to A) and Non-Numerals (0 to 9). Mean to say as a way back to get a regular expression different from alphabets and other numbers (0 to 9).

Please offer a solution for the same.

+5
source share
3 answers

You can use a negative character class :

[^a-zA-Z0-9]

Above the regular expression will correspond to one character, which cannot be Latin lowercase or uppercase letters or a number.

^ ( [ ]) , - , .

, , , :

  • [^a-zA-Z0-9]*
    

    (*) , .

  • [^a-zA-Z0-9]+
    

    (+) , .

  • (, ) ,

    ^[^a-zA-Z0-9]*$
    

    ^ $ anchors, , , , , , .

  • () ,

    ^[^a-zA-Z0-9]+$
    

, ( ) , - , , . Β , . , . á , ́a ( á a ).

.

, : ١٢٣: -)

[^\p{L&}\p{Nd}]

.

+17

:

[^A-Za-z0-9]

+2

, :

[^[:alnum:]]
+2
source

All Articles