Regular Expressions (RegEx)
,• A regular expression is a sequence of characters that forms
search pattern.
• Regular Expressions or Regex (in short) in Java is an API
defining String patterns that can be used for searchi
manipulating, and editing a string in Java.
• Email validation,passwords,phone number are a few areas
strings where Regex is widely used to define the constraints.
• Regular Expressions in Java are provid
under java.util.regex package.
, Regex Classes and Interfaces
Class/Interface Description
Pattern Class Used for defining patterns
Used for performing match operations on text us
Matcher Class
patterns
PatternSyntaxException Used for indicating syntax error in a regular expres
Class pattern
MatchResult Interface Used for representing the result of a match opera
,• A regular expression is a sequence of characters that forms
search pattern.
• Regular Expressions or Regex (in short) in Java is an API
defining String patterns that can be used for searchi
manipulating, and editing a string in Java.
• Email validation,passwords,phone number are a few areas
strings where Regex is widely used to define the constraints.
• Regular Expressions in Java are provid
under java.util.regex package.
, Regex Classes and Interfaces
Class/Interface Description
Pattern Class Used for defining patterns
Used for performing match operations on text us
Matcher Class
patterns
PatternSyntaxException Used for indicating syntax error in a regular expres
Class pattern
MatchResult Interface Used for representing the result of a match opera