Groovy JDK

java.util.regex
Class Pattern

Method Summary
boolean isCase(Object switchValue)
'Case' implementation for the Pattern class, which allows testing a String against a number of regular expressions.
 
Method Detail

isCase

public boolean isCase(Object switchValue)
 
'Case' implementation for the 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
Since:
1.0

Groovy JDK