# 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**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/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>\<string:input><br>\<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>\<string:pattern><br>\<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>                                                                                                                                                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/wild.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
