Takes a string and regex and returns the results that matched.
An example workflow of using the container on Direktiv.
id: regex-msg
functions:
- id: regex
image: direktiv/regex:v1
description: Checks a string against regex and returns the matches
states:
- id: reg
type: action
action:
function: regex
input:
msg: jq(.return.msg)
regex: "\\+[0-9]{1,2}[0-9]{9}"
The input required to run the container needs a json struct like the following:
{
"msg": "hello test 053443533",
"regex": "\\+[0-9]{1,2}[0-9]{9}"
}
The output of the container is an array called results.
{
"return": {
"results": ["f", "x"]
}
}
In the case that an error is encountered it will present in the following format:
{
"errorCode": "com.regex.error",
"errorMsg": "Something went Wrong"
}
Content type
Image
Digest
sha256:81c52040a…
Size
2.1 MB
Last updated
almost 4 years ago
docker pull westwind027/regex