regexReplace := regex_replace(Args{regex: "(foo)", text: "foo bar baz"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Replaced String: " + regexReplace.replaced_string,
})
Regex Replace
BlockRegex
Replace all matches of a regular expression in a string.
Inputs
RegexRequired
Regular expression to search with.
Example: (foo)
TextRequired
Text to run the regex against.
Example: foo bar baz
Replacement
Text to replace matches with.
Example: qux
Outputs
Replaced String
String after all replacements.
Example: qux bar baz
Build a bot using blocks like Regex Replace
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_replaceInputs
| Field | InventScript name | Value |
|---|---|---|
| Regex | regex | e.g. "(foo)" |
| Text | text | e.g. "foo bar baz" |
| Replacement | replacement | e.g. "qux" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Replaced String | replaced_string | e.g. "qux bar baz" |