When the search for a match requires something more than a direct match, such as finding one or more b's, or finding white space, you can include special characters in the pattern.
For example, to match a single 'a' followed by zero or more 'b's followed by 'c', you'd use the pattern after 'b' means "0 or more occurrences of the preceding item." In the string "cbbabbbbcdebc," the pattern matches the substring 'abbbbc'.
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.
If the regular expression remains constant, using this can improve performance.A word boundary is not a "character" to be matched; like an anchor, a word boundary is not included in the match.In other words, the length of a matched word boundary is zero.You can specify a range of characters by using a hyphen.Everything that works in the normal character set also works here. A word boundary matches the position between a word character followed by a non-word character, or between a non-word character followed by a word character, or the beginning of the string, or the end of the string.