---
title: "exMatches"
canonical: "https://help.agiloft.com/space/HELP/65340870/exMatches"
format: markdown
---
The matches formula matches character sequences against patterns specified by [regular expressions](http://www.regular-expressions.info/) (regex) and returns true if and only if the entire text matches the pattern. The matches function accepts only strings as arguments.  You can force the system to evaluate some non-string data types as strings by adding an empty string with +"". 

#### Syntax

`matches(pattern, text[,flags])`

#### Example

| **Example formula** | **Output** |
| --- | --- |
| `matches("Sales Department",$linked_department)` | Returns true if the $linked_department field contains 'Sales Department'. |
| `matches("3",$id+"")` | Returns true if the $id, converted to a string, is 3. |

#### Flags

Case-insensitive matching and multi-line mode are enabled by the optional flags "i" and "m" respectively, or "im" to enable both. Multi-line mode affects searches on text fields or other data types with multiple lines. If multi-line mode is not enabled in these circumstances, line breaks are treated as spaces.