# RegExMatches

{% hint style="info" %}
The **`RegExMatches()`** checks a text for patterns and returns all matching results.

All regex functions use a pattern to check for matches in the input text.&#x20;

For a more complete explanation and special / allowed characters you can visit [**this WEM Forum post**](https://my.wem.io/forum?threadid=459). Here you find a cheat-sheet and a few helpful examples.

This function is NOT SQL compatible. For more information about SQL compatibility, see our [documentation](https://docs.wem.io/platform/~/changes/y5gAfiyi2fILzrLzUUHj/wemreference/sql-compatibility).
{% endhint %}

{% hint style="success" %}
Returns an <mark style="color:green;">array</mark> of all matching values. \
Returns <mark style="color:red;">`Invalid expression`</mark> if no matches are found or the pattern is faulty.
{% endhint %}

### Syntax

<details>

<summary><code>RegExMatches(</code><mark style="color:blue;"><code>pattern</code></mark><code>, </code><mark style="color:blue;"><code>text</code></mark><code>)</code></summary>

`RegExMatches("\\b\\w+es\\b", "There are matches in this line, but who writes these notes anyway?")`\
\&#xNAN;*=> "matches, writes, notes"*

</details>

### Parameters

<table><thead><tr><th width="164.70825474075613">Name</th><th width="150">Type</th><th width="150" align="center">Required</th><th width="248.15953250810662">Description</th><th data-hidden>Required?</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>pattern</code></mark></td><td>text</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2611">☑️</span></td><td>The pattern you want to check for.</td><td>yes</td></tr><tr><td><mark style="color:blue;"><code>text</code></mark></td><td>text</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2611">☑️</span></td><td>The text you want to check for patterns. </td><td>yes</td></tr></tbody></table>
