# Patterns methods

## clearCache( patternName, directoryOverride ) <a href="#clearcache" id="clearcache"></a>

Removes a pattern from cache.

* **`patternName`** The name of the pattern file
* **`directoryOverride`** If the cached pattern was originally retrieved also using `directoryOverride`, the same value needs to be specified here.

## pars&#x65;**( patternName, setup )** <a href="#parse" id="parse"></a>

Parses a pattern

* **`patternName`** The name of the pattern file
* **`setup`** Optional hash array
  * **`directoryOverride`** When specified, the pattern is taken from this directory instead of the default configured directory.
  * **`noParse`** When set to true, the pattern is returned without any parsing.
  * **`fileToIncludeBeforeParsing`** A file or an array of files to include whenever parsing this set files, usually for defining variables that can be later used inside the pattern.
  * **`variables`** A hash array of variables passed to be available when parsing the pattern.

**Returns:** The parsed pattern, or false if failed.

## out( patternName, setup, code ) <a href="#out" id="out"></a>

Parses a pattern and sets the result as the output response payload.

* **`patternName`** The name of the pattern file
* **`setup`** Optional hash array: The options to be passed to the [parse](/reference/core-modules/patterns.md#parse-patternname-setup) method
* **`code`** Optional integer: The response code, one of the available RESPONSE\_\*


---

# 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://cherrycake.tin.cat/reference/core-modules/patterns/methods.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.
