Validating special characters

Using regular expressions the entered content can be validated with advanced conditions like the string entered shouldn’t contain spaces, special characters, numbers, uppercase or lowercase etc.Once you learn the art of using regular expressions you can use it with many computer languages.The following is how regular expressions can be used [abc] – find any character in the brackets a, b or c [a-z] – find the range of characters within brackets i.e. Can also be used with numbers [0-9] [^xyz] – find any character other than the ones specified in the brackets i.e.x,y and z (word) – find the “word” specified in the round brackets [abc|xyz] – find either the characters a,b,c or x,y,z We’ll start first with validating a textbox that accepts only numbers.In list below the third value though should return false, but returns true.

I would prefer adding the user's invalid characters to the message as they are entered.Special characters $, @ and # are allowed if program-ids are specified as literals.Following function will allow only number and special characteres mentioned in regex now you can modify according yo your need.There are 256 ASCII (American Standard Code for Information Interchange) characters.Among them, there are the letters of the alphabet, the digits, the letters specific to some languages like é in French, and this famous non-printable special characters which are not displayed with a DEC HEX Description 0 00 NUL Null 1 01 STX Start of Header 2 02 SOT Start of Text 3 03 ETX End of Text 4 04 EOT End of Transmission 5 05 ENQ Enquiry 6 06 ACK Acknowledge 7 07 BEL Bell 8 08 BS Back Space 9 09 HT Horizontal Tabulation 10 0A LF Line Feed 11 0B VT Vertical Tabulation 12 0C FF Form Feed 13 0D CR Carriage Return 14 0E SO Shift Out 15 0F SI Shift In 16 10 DLE Data Link Escape 17 11 DC1 Device Control 1 (XON) 18 12 DC2 Device Control 2 19 13 DC3 Device Control 3 (XOFF) 20 14 DC4 Device Control 4 21 15 NAK Negative acknowledge 22 16 SYN Synchronous Idle 23 17 ETB End of Transmission Block 24 18 CAN Cancel/Annuler 25 19 EM End of Medium 26 1A SUB Substitute/Substituer 27 1B ESC Escape/Echappe 28 1C FS File Separator 29 1D GS Group Separator 30 1E RS Record Separator 31 1F US Unit Separator 32 20 [Space] Space 33 21 !

Search for validating special characters:

validating special characters-66validating special characters-3validating special characters-55validating special characters-50

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating special characters”