All about Java String.
Built in support is provided by Strings present in Java for the regular expressions. There are 3 built in methods present in Strings for regular expressions. For example: replace(), split() and matches().
There is no optimization of methods for performance. Classes will be used later on, which are performance optimized. s.matches("regex"): Evaluates if "regex" matches s. Returns only true if the WHOLE string can be matched s.split("regex")