Regex matcher

[string/Regex matcher]


Matches a string to a non-global regular expression.


Keywords: string, regular expression, regex

Input ports

  • string: string

    Receives the string to be matched.

Example: "The quick brown fox jumps over the lazy dog. It barked."

  • regex: string

    Receives the regular expression.

Example: "(?fox|cat) jumps over"

Output ports

  • matches: boolean

    Whether the given regex matches the given string; Example: true

  • matched: (string or null)

    Sends the matched text. Example: "fox jumps over"

  • groups: string[]

    Sends the capturing groups matched by the given regex pattern. Example:

    [ "fox" ]<br>
    ```<br>
    
  • named groups: {string: string}

    Sends the named capturing groups matched by the given regex pattern. Keys are the names and values are the capturing group or null if no named capturing groups were defined. Example:

    {<br>
      "animal": "fox"<br>
    }<br>
    ```<br>

Last updated