RegEx.MatchList
---------------

Matches a list against a pattern.

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

MBS( "RegEx.MatchList"; Pattern; List; CompilerOptions; ExecuteOptions ) 

**MBS**( **"RegEx.MatchList";** /\* Matches a list against a pattern. \*/  
**$Pattern**; /\* The pattern to use.e.g. "H(.\*)" \*/   
**$List**; /\* The list of texts to search.e.g. "Hello" \*/   
**$CompilerOptions**; /\* A number for the options to use. e.g. 1 for case insensitive or 512 for ungreedy.  
Can be given as text or number.e.g. 512+1 \*/   
**$ExecuteOptions**) /\* The options for executing.  
Can be given as text or number.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Pattern | The pattern to use. | "H(.\*)" |
| List | The list of texts to search. | "Hello" |
| CompilerOptions | A number for the options to use. e.g. 1 for case insensitive or 512 for ungreedy.   Can be given as text or number. | 512+1 |
| ExecuteOptions | The options for executing.   Can be given as text or number. | 0 |

### 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.  
  
| Compile option | Number | Description |
|---|---|---|
| Caseless | 1 | Do caseless matching |
| Multiline | 2 | ^ and $ match newlines within data |
| Dot All | 4 | . matches anything including NL |
| Extended | 8 | Ignore white space and # comments |
| Anchored | 16 | Force pattern anchoring |
| Dollar End Only | 32 | $ not to match newline at end |
| Ungreedy | 512 | Invert greediness of quantifiers |
| No Auto Capture | 4096 | Disable numbered capturing parentheses (named ones available) |
| Auto Callout | 16384 | Compile automatic callouts |
| FirstLine | 262144 | Force matching to be before newline |
| Dup Names | 524288 | Allow duplicate names for subpatterns |
| Newline CR | 1048576 | Set CR as the newline sequence |
| Newline LF | 2097152 | Set LF as the newline sequence |
| Newline CRLF | 3145728 | Set CRLF as the newline sequence |
| Newline Any | 4194304 | Recognize any Unicode newline sequence |
| Newline Any CRLF | 5242880 | Recognize CR, LF, and CRLF as newline sequences |
| BSR Any CRLF | 8388608 | \\R matches only CR, LF, or CRLF |
| BSR Unicode | 16777216 | \\R matches all Unicode line endings |
| JavaScript Compatible | 33554432 | JavaScript compatibility |
| No start optimize | 67108864 | Disable match-time start optimizations |

  
| Execute option | Number | Description |
|---|---|---|
| Anchored | 16 | Force pattern anchoring |
| Not BOL | 128 | Subject string is not the beginning of a line |
| Not EOL | 256 | Subject string is not the end of a line |
| Not Empty | 1024 | An empty string is not a valid match |
| Partial | 32768 | Allow partial results. |
| Newline CR | 1048576 | Set CR as the newline sequence |
| Newline LF | 2097152 | Set LF as the newline sequence |
| Newline CRLF | 3145728 | Set CRLF as the newline sequence |
| Newline Any | 4194304 | Recognize any Unicode newline sequence |
| Newline Any CRLF | 5242880 | Recognize CR, LF, and CRLF as newline sequences |
| BSR Any CRLF | 8388608 | \\R matches only CR, LF, or CRLF |
| BSR Unicode | 16777216 | \\R matches all Unicode line endings |
| No start optimize | 67108864 | Disable match-time start optimizations |
| Partial Hard | 134217728 | Return partial result if found before . |
| Not Empty At Start | 268435456 | An empty string at the start of the subject is not a valid match |
| UCP | 536870912 | Use Unicode properties for \\d, \\w, etc. |

  
Please pass sum of the numbers to select options.  
### Examples

Match Hello with pattern:

 MBS ( "RegEx.MatchList"; "H(.\*)o"; "Hello¶Test¶World¶House¶Test")  
### See also

- [RegEx.Match](RegExMatch.md)

### Blog Entries

- [Regular Expressions in FileMaker](https://www.mbsplugins.de/archive/2023-03-19/Regular_Expressions_in_FileMak/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 17th October 2017

  
[RegEx.Match](RegExMatch.md) - [RegEx.MinimumLength](RegExMinimumLength.md)

[HTML Version](RegExMatchList.shtml)