-
In Form Validations / To Build Validation Frameworks
- To validate mobile numbers, email IDs, employee IDs.
-
To Develop Pattern Matching Applications
- Examples:
ctrl+ffor find,grepfor search.
- Examples:
-
To Develop Translators like Compilers, Assemblers, Interpreters
Compiler Design:
- LA → Lexical Analysis / Tokenization / Scanning.
- SA → Semantic Analysis.
- SA → Syntax Analysis.
- ICG → Intermediate Code Generation.
- CO → Code Optimization.
- TCG → Target Code Generation.
-
To Develop Digital Machines
- Examples: Binary Incrementer, Multiplier, etc.
-
To Develop Communication Protocols
- Examples: TCP/IP, UDP.
If we want to represent a group of strings according to a particular pattern, then we should go for regular expressions. By using wildcard characters, we can build regular expressions. A wildcard character can be used as a substitute for a required sequence of characters in the regular expression.
*→ Represents zero or more characters.?→ Represents only one character.[]→ Range of characters.[abc]→ Either 'a', 'b', or 'c'.[!abc]→ Any character except 'a', 'b', and 'c'.[a-z]→ Any lowercase alphabet symbol.[A-Z]→ Any uppercase alphabet symbol.[a-zA-Z]→ Any alphabet symbol.[0-9]→ Any digit from 0 to 9.[a-zA-Z0-9]→ Any alphanumeric character.[!a-zA-Z0-9]→ Any character except alphanumeric (i.e., special symbols).[[:lower:]]→ Any lowercase alphabet symbol.[[:upper:]]→ Any uppercase alphabet symbol.[[:alpha:]]→ Any alphabet symbol.[[:digit:]]→ Any digit from 0 to 9.[[:alnum:]]→ Any alphanumeric character.[![:digit:]]→ Any character except digits.{}→ List of files with comma separators.