devxlogo

March 6, 2019

Escape Characters in Regular Expressions

In Java, characters as  cannot appear in a regular expression without being escaped. For this, rely on the Pattern.quote() method as in the following example: public static boolean contains(String t1, String