Groovy JDK

java.util.regex
Class Pattern

Method Summary
boolean isCase(Object switchValue)
'Case' implementation for the {@link Pattern} class, which allows testing a String against a number of regular expressions For example:
switch( str ) {
case ~/one/ :
// the regex 'one' matches the value of str
}
Note that this returns true for the case where both the pattern and the 'switch' values are null
 
Method Detail

isCase

public boolean isCase(Object switchValue)
'Case' implementation for the {@link Pattern} class, which allows testing a String against a number of regular expressions. For example:
switch( str ) {
case ~/one/ :
// the regex 'one' matches the value of str
}
Note that this returns true for the case where both the pattern and the 'switch' values are null.

Parameters:
switchValue - the switch value.
Returns:
true if the switchValue is deemed to match the caseValue

Groovy JDK