Wildcard: It matches any characters from characters to numbers and alphanumeric variables.
For example, say we want to match phone numbers in a large document. we know that the numbers may contain hyphens, plus symbol etc. (e.g. +91-9925417854) , but it will not have any alphabet. we need to specify that we need only for numerics and some other symbols, but avoid alphabets.
To handle such situations, we can use character sets in regular expressions
We commonly use sets to match only digits, only alphabets, only alphanumeric characters, only whitespaces, etc. Therefore, there is a shorthand way to write commonly used character sets in regular expressions. These are called as meta-sequences
No comments:
Post a Comment