Archive for the ‘ Regular Expression ’ Category
From various sources I have collected the following regular expression patterns. They helped me a lot in front-end and back-end validation. Alpha: Pattern: ^[a-zA-Z_ ]+$ Description: Allows only ‘A-Z’, ‘a-z’, space ( ‘ ‘ ) and underscore ( ‘_’). Alphanumeric: Pattern: ^[a-zA-Z0-9_ ]+$ Description: Allows only ‘A-Z’, ‘a-z’, ‘0-9′, space ( ‘ ‘ ) and underscore ( ‘_’). Email: Pattern: /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i Numeric: Pattern: ^\d+$ Decimal: Pattern: ^\d+(?:\.\d{0,2})?$ Date [ READ MORE ]