Regex Match

BlockRegex

Check if a string matches a regular expression.

Inputs

RegexRequired

Regular expression to evaluate.

Example: ^hello

TextRequired

Text to test against the regex.

Example: hello world

Outputs

Match

Whether the text matches the regex.

Example: true

Build a bot using blocks like Regex Match

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: regex_match

Inputs

FieldInventScript nameValue
Regexregexe.g. "^hello"
Texttexte.g. "hello world"

Outputs

FieldInventScript nameValue
Matchmatche.g. "true"

Example InventScript

regexMatch := regex_match(Args{regex: "^hello", text: "hello world"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Match: " + regexMatch.match,
})

More regex blocks