In literal strings, backlash is considered as escape character. It is basically a single backlash i.e. \\. Backlash is also considered an escape character in case of regular expressions. A single backlash is matched to the regular expression \\. As a java string, regular expression would become \\\\. Four backlashes are used for matching just one single.
Word character is being matched with regex \w. It is abbreviated as "\\w".
Similar backlash mess up
Package java.util.regex has three classes: PatternSyntaxException, Matcher and Pattern. Pattern object is basically the compiled presentation of regular expression. For pattern creation first thing is invoking public static methods of compilation that will make pattern object to be returned. Regular expression is accepted by these methods being 1st argument; 1st trial lessons will let you know regarding the required syntax.Matcher object is considered to be an engine which will
For strings, search pattern is defined by the regular expression. Such kind of pattern might be matching one time or several times, or not at all. Regular expression has an abbreviation regex.
String (literal) is a simpler example of regular expression. E.g. Hello World string will be matched with Hello World regex.
Other regular expression example is (dot) . That match with just one single character; and it will be matching e.g. zor a or 1. Usage