public boolean matches (String regex)

Tells whether or not this string matches the given regular expression.

An invocation of this method of the form str.matches(regex) yields exactly the same result as the expression

java.util.regex.Pattern.java.util.regex.Pattern.matches(String,CharSequence)(regex, str)

Parameters:
regex     the regular expression to which this string is to be matched

Returns:  true if, and only if, this string matches the given regular expression

Exceptions:
PatternSyntaxException     if the regular expression's syntax is invalid

See also:
java.util.regex.Pattern

Since:  1.4

@spec JSR-51