> For the complete documentation index, see [llms.txt](https://knowledge.out-smart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.out-smart.com/marketplace-packages-and-power-ups/power-ups/mail-to-workorder/parse-email-content-with-regex-and-advanced-options.md).

# Parse email content with regex and advanced options

Use regex rules when the email contains structured data you want to extract automatically.

Use advanced options when you need attachment parsing or a specific content mode.

### Regex rules

A regex rule usually contains:

* the regex pattern
* the field to populate
* the match index to use

This is useful when the email contains repeatable labels such as customer number, phone number, or object code.

### Advanced options

Advanced options can include:

* parsing attachments
* choosing **TEXT** or **HTML** content mode
* forcing a debtor number

### When to use regex instead of forced values

Use forced values when the same value should always be written.

Use regex when the value should be extracted from each incoming email.

### Configure regex and advanced options

{% stepper %}
{% step %}

### Open a configuration

Open the mail configuration you want to edit.
{% endstep %}

{% step %}

### Enable advanced options

Enable the advanced mode for the configuration.
{% endstep %}

{% step %}

### Add regex rules

Add a regex pattern, select the target field, and choose the right match index.
{% endstep %}

{% step %}

### Configure extra options

Enable attachment parsing or choose the right content mode.
{% endstep %}

{% step %}

### Save and test

Test the configuration with a sample email that contains the expected structure.
{% endstep %}
{% endstepper %}

### Practical tips

* start with simple patterns
* test against real email samples
* use TEXT mode when HTML formatting breaks your pattern

### Frequently asked questions

<details>

<summary>Do I need regex knowledge?</summary>

Yes.

Regex rules are best for admins who are comfortable testing patterns.

</details>

<details>

<summary>What does MatchIndex do?</summary>

It selects which capture group value is written to the field.

</details>

<details>

<summary>Can attachments be added to the work order?</summary>

Yes, if attachment parsing is enabled and the files are supported.

</details>

### Related topics

* [**Configure forced values and parameters**](/marketplace-packages-and-power-ups/power-ups/mail-to-workorder/configure-forced-values-and-parameters.md)
* [**Create and manage mail configurations**](/marketplace-packages-and-power-ups/power-ups/mail-to-workorder/create-and-manage-mail-configurations.md)
* [**Set up WorkOrder Drop mode**](/marketplace-packages-and-power-ups/power-ups/mail-to-workorder/set-up-workorder-drop-mode.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://knowledge.out-smart.com/marketplace-packages-and-power-ups/power-ups/mail-to-workorder/parse-email-content-with-regex-and-advanced-options.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
