Regular expressions provides a quick and easy way of matching a string to a pattern.
Validation of mobile no, username, email id, website url are possible through Regular expressions.
' doesn't match any character; it denotes a word boundary.
The match made with this part of the pattern is remembered for later use, as described in Using parenthesized substring matches.
Simple patterns are constructed of characters for which you want to find a direct match.
A backslash that precedes a special character indicates that the next character is not special and should be interpreted literally. If you're using the Reg Exp constructor with a string, don't forget that backslash is an escape character in string literals, and so to put a backslash in the pattern, you need to escape it in the string literal.
matches the 'el' in "angel" and the 'le' in "angle" and also the 'l' in "oslo".