Regex

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

Available since Koryphe version 1.0.0

Checks if a string matches a pattern

Examples

Regex with pattern

Java
JSON
Full JSON
Python
final Regex function = new Regex("[a-d0-4]");
{
  "class" : "Regex",
  "value" : {
    "java.util.regex.Pattern" : "[a-d0-4]"
  }
}
{
  "class" : "uk.gov.gchq.koryphe.impl.predicate.Regex",
  "value" : {
    "java.util.regex.Pattern" : "[a-d0-4]"
  }
}
g.Regex( 
  value={'java.util.regex.Pattern': '[a-d0-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 ""