# Wild

The **Wild** object allows a script to access the in-built pattern matching functions in Opus. Even though most ActiveX scripting languages have their own pattern matching support (usually via a regular expression system of some sort), you may wish to use the one that Opus provides for consistency with internal Opus functions.

You can create a **Wild** object using the [**FSUtil**](fsutil)**.NewWild** method. To use the **Wild** object, you must first give it the pattern to match against (this step is called "parsing the pattern"). You can do this when it is created or later on using the **Parse** method. Once the object has a pattern you can call the **Match** method to test a string against the pattern.

| Property Name      | Return Type | Description                                    |
| ------------------ | ----------- | ---------------------------------------------- |
| _\<default value>_ | _string_    | Returns the current pattern in the Wild object |

| Method Name  | **Arguments**                                       | Return Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------ | --------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| EscapeString | <p>&#x3C;string:input><br>&#x3C;string:type></p>    | _string_    | <p>Escapes all wildcard characters in the input string and returns the result. For example, "<strong>the * 'dog' said</strong> *" would be conterted to "<strong>the '* ''dog'' said '</strong>*".</p><p>The optional type argument lets you specify the conversion:<br><em>none</em>: Escape characters used in <a href="../../wildcard_reference/pattern_matching_syntax">standard pattern matching</a><br><strong>r</strong>: Escape characters used in <a href="../../wildcard_reference/regular_expression_syntax">regular expressions</a> <br><strong>b</strong>: Double all back-slashes<br><strong>n</strong>: Double all back-slashes that come before the letter '<strong>n</strong>'<br>Note that these modes cannot be combined.</p> |
| Match        | \<string:test>                                      | _bool_      | Compares the specified string against the previously-parsed pattern, and returns **True** if it matches.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Parse        | <p>&#x3C;string:pattern><br>&#x3C;string:flags></p> | _bool_      | <p>Parses the supplied pattern. The flags string is optional - if supplied it must be a string consisting of one or more of the following characters:</p><p><strong>c</strong> - case-sensitive (otherwise pattern matching is not case-sensitive) <br><strong>d</strong> - DOS only (only standard MS-DOS wildcards are supported)<br><strong>f</strong> - filename mode (special handling for matching filenames)<br><strong>r</strong> - regular expression (otherwise <a href="../../wildcard_reference/pattern_matching_syntax">standard pattern matching</a> is used)</p>                                                                                                                                                                  |
