java tutorial - Java Strings matches() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java strings matches - Java examples - Java programs
Description
The matches () method — in Java, tells whether or not the given string matches a given regular expression. Calling this method from the str.matches (regex) form produces exactly the same result as the expression Pattern.matches (regex, str).
Syntax
Syntax method:
Options
Detailed information about the parameters:
- regex is a regular expression to which this string must match.
Return value
- In Java matches (), returns true if, and only if this string matches a specified regular expression.