MultiRegex

See javadoc - uk.gov.gchq.koryphe.impl.predicate.MultiRegex

Available since Koryphe version 1.0.0

Checks if a string matches at least one pattern

Examples

Multi regex with pattern

Java
JSON
Full JSON
Python
final MultiRegex function = new MultiRegex(new Pattern[]{Pattern.compile("[a-d]"), Pattern.compile("[0-4]")});
{
  "class" : "MultiRegex",
  "value" : [ {
    "java.util.regex.Pattern" : "[a-d]"
  }, {
    "java.util.regex.Pattern" : "[0-4]"
  } ]
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.MultiRegex",
  "value" : [ {
    "java.util.regex.Pattern" : "[a-d]"
  }, {
    "java.util.regex.Pattern" : "[0-4]"
  } ]
}
g.MultiRegex( 
  value=[ 
    {'java.util.regex.Pattern': '[a-d]'}, 
    {'java.util.regex.Pattern': '[0-4]'} 
  ] 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult
java.lang.Stringatrue
java.lang.Stringzfalse
java.lang.Stringazfalse
java.lang.CharacteraClassCastException: java.lang.Character cannot be cast to java.lang.String
java.lang.String2true
java.lang.Integer2ClassCastException: java.lang.Integer cannot be cast to java.lang.String
java.lang.Long2ClassCastException: java.lang.Long cannot be cast to java.lang.String

results matching ""

    No results matching ""