Home » Core Java » Java Regular Expressions

Java Regular Expressions

Java Regular Expressions ::

1. java.util.regex API is used for pattern matching using regular expressions
2. java.util.regex.Pattern and java.util.regex.Matcher are the two main classed in java.util.regex API.
3. class java.util.regex.Pattern extends Object class and implements Serializable class.
4. A regular expression, specified as a string, must first be compiled into an instance of Pattern class. The resulting pattern can then be used to create a Matcher object that can match arbitrary character sequences against the regular expression. All of the state involved in performing a match resides in the matcher, so many matchers can share the same pattern.


Leave a comment

Your email address will not be published. Required fields are marked *

nineteen + 10 =