StringRegexReplace

See javadoc - uk.gov.gchq.koryphe.impl.function.StringRegexReplace

Available since Koryphe version 1.9.0

Replace all portions of a string which match a regular expression.

Examples

Replace strings

Java
JSON
Full JSON
Python
final StringRegexReplace function = new StringRegexReplace("[tT]ea", "cake");
{
  "class" : "StringRegexReplace",
  "regex" : "[tT]ea",
  "replacement" : "cake"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.StringRegexReplace",
  "regex" : "[tT]ea",
  "replacement" : "cake"
}
g.StringRegexReplace( 
  replacement="cake", 
  regex="[tT]ea" 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult TypeResult
java.lang.Stringteajava.lang.Stringcake
java.lang.StringTeajava.lang.Stringcake
java.lang.StringTEAjava.lang.StringTEA
java.lang.Stringbrainteaserjava.lang.Stringbraincakeser
nullnull
java.lang.Stringcoffeejava.lang.Stringcoffee
java.lang.Long5ClassCastException: java.lang.Long cannot be cast to java.lang.String

results matching ""

    No results matching ""