List.RegExMatch
---------------

Matches a list against a pattern.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [List](component_List.md) | [4.4](newinversion44.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "List.RegExMatch"; List; Pattern; CompilerOptions; ExecuteOptions { ; NoReturnEnding } ) 

**MBS**( **"List.RegExMatch"** /\* Matches a list against a pattern. \*/  
**$List**; /\* The list of texts to search. e.g. "Hello" \*/   
**$Pattern**; /\* The pattern to use. e.g. "H(.\*)" \*/   
**$CompilerOptions**; /\* A number for the options to use. e.g. 1 for case insensitive or 512 for ungreedy. e.g. 512+1 \*/   
**$ExecuteOptions**; /\* The options for executing. e.g. 0 \*/   
**$NoReturnEnding**) /\* Optional; Pass 1 to have no extra newline character on the end of the returned list. Default is 0 to include one to easily concat lists. e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| List | The list of texts to search. | "Hello" |  |
| Pattern | The pattern to use. | "H(.\*)" |  |
| CompilerOptions | A number for the options to use. e.g. 1 for case insensitive or 512 for ungreedy. | 512+1 |  |
| ExecuteOptions | The options for executing. | 0 |  |
| NoReturnEnding | Pass 1 to have no extra newline character on the end of the returned list. Default is 0 to include one to easily concat lists. | 1 | Optional |

### Result

Returns list or error.

### Description

Matches a list against a pattern.  
This compiles the pattern, executes it and looks if we have a match or not for each list item.  
Returns the list items which match.  
### Examples

Match Hello with pattern:

 MBS ( "List.RegExMatch"; "Hello¶Test¶World¶House¶Test"; "H(.\*)o")  
same without return on end of result:

 MBS ( "List.RegExMatch"; "Hello¶Test¶World¶House¶Test"; "H(.\*)o"; 0; 0; 1)  
### See also

- [List.BestMatch](ListBestMatch.md)
- [QuickList.RegExMatch](QuickListRegExMatch.md)

### Release notes

- **Version 15.1**
    - Improved [List.RegExMatch](https://www.mbsplugins.eu/ListRegExMatch.shtml) and [QuickList.RegExMatch](https://www.mbsplugins.eu/QuickListRegExMatch.shtml) to take options in text form in addition to integers.

### Blog Entries

- [MBS FileMaker Plugin, version 15.1pr2](https://www.mbsplugins.de/archive/2025-02-06/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.4pr9](https://www.mbsplugins.de/archive/2014-11-05/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 2nd November 2014 , last changed 29th June 2015

  
[List.OrColumn](ListOrColumn.md) - [List.Remove](ListRemove.md)

[HTML Version](ListRegExMatch.shtml)