Match () with regex () ()
Jump to navigation
Jump to search
The match regex block is a reporter block that matches a string with a regular expression, a regex.
Use
This block searches for every instance of the selected rule. The rule can be inserted into the second input box. The third input box acts as a flag (more info later on)
Examples
Foo bar example
(match [foo bar] with regex [foo] [g] :: operators) // ["foo"]
In this example inputs of the block it searches for the string "foo" in the string "foo bar" which will result in the array ["foo"] since there is only one foo in the string.
Fruit example
(match [banana orange apple banana banana pear apple] with regex [banana] [g] :: operators) // ["banana","banana","banana"]
For this example the block searches for every occurance of the word "banana" which results in the array ["banana","banana","banana"].