RegEx.Pattern
-------------

Queries the pattern used to compile this regular expression.

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

MBS( "RegEx.Pattern"; RegExRef ) 

**MBS**( **"RegEx.Pattern";** /\* Queries the pattern used to compile this regular expression. \*/  
**$RegExRef**) /\* The reference number for the regular expression returned from [RegEx.Compile](RegExCompile.md).e.g. $regex \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| RegExRef | The reference number for the regular expression returned from [RegEx.Compile](RegExCompile.md). | $regex |

### Result

Returns text or error.

### Description

Queries the pattern used to compile this regular expression.  
### Examples

Query pattern:

 Set Variable \[ $Pattern ; Value: "H(.\*)o (.)or(..)" \]   
Set Variable \[ $Regex ; Value: MBS ("[RegEx.Compile](RegExCompile.md)"; $Pattern ; "CaseLess") \]   
Show Custom Dialog \[ "Pattern used" ; MBS ( "RegEx.Pattern"; $RegEx ) \]   
Set Variable \[ $r ; Value: MBS ("[RegEx.Release](RegExRelease.md)"; $RegEx ) \]  
### See also

- [RegEx.Compile](RegExCompile.md)
- [RegEx.Release](RegExRelease.md)

This function is free to use.

Created 26th October 2014 , last changed 26th April 2023

  
[RegEx.Options](RegExOptions.md) - [RegEx.Quote](RegExQuote.md)

[HTML Version](RegExPattern.shtml)