String.matches()

Signature

boolean matches (String s1, String regex)

Domain

action, condition

Description

Tells whether or not this string matches the given regular expression. To see a description of the regular expression syntax, see the java.util.regex.Pattern documentation.

Parameters

NameTypeDescription
s1StringA String to search.
regexStringThe regular expression to which the String s1 is to be matched.

Returns

TypeDescription
booleantrue if the String s1 matches the regular expression regex, otherwise returns false.

Cautions

none

See Also

java.util.regex.Pattern