test

This block is part of the condition group and was last modified in core v15.0.0.

test v15.0.0

Returns true if the regular expression matches the text. Mirrors JS RegExp.prototype.test().

In pins 4
  • text required
    value

    Text to test against.

  • expression required
    value

    The expression without flags.

  • insensitive
    condition

    Makes the whole expression case-insensitive.

    Default false

  • multline
    condition

    Begin/end anchors will match the start/end of a line.

    Default false

Out pins 1
  • match
    condition

True when expression, compiled as a JS-flavor regex, matches anywhere in text (unanchored). Case-sensitive unless insensitive=true; multline makes ^ and $ match at line boundaries. An invalid expression outputs false; an empty expression matches everything (true).

A typical wiring for test: value feeds the text pin; convert to lowercase feeds the expression pin; the condition out pin feeds if.

Studio canvas example for the test block: typical wiring for test.

Commonly used with

In production blueprints, this block is most often wired together with:

  • value: feeds into this block. Simply returns the provided value.
  • if: this block feeds into it. Conditional branching for values (if.. then.. else..). Selects which input value is passed through; it does not route flow.
  • convert to lowercase: feeds into this block.
  • === false: this block feeds into it. returns true if the boolean is not true. Despite the === false label this is a !== true test: null, 0 and any other non-true value also pass.
  • trim: feeds into this block. Removes characters from both ends of a string.

Version history

Introduced in v15.0.0.


Back to condition Return to the main group to view all sub-groups Back to regexp Return to the group to view all blocks within this group