Using ticket automation RegEx expressions for AI agents

<p id="docs-hc-snippet" style="display: none;">
Zendesk AI agents are AI-powered chatbots that interact with your customers
on messaging, email (including API and web form), and voice (EAP) channels.
They can have conversations with customers and perform actions in authorized
systems autonomously, automating and resolving issues so that your human
agents can focus on more complex work.
</p>
<div class="article-banners">
<div id="docs-wmp-link">
<a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a>
</div>
<div class="article-banner" id="suite_all">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Team, Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>
<div class="article-banner" id="support_all">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>Support</strong>
</td>
<td>Team, Professional, or Enterprise</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>
In this article, we will be covering RegEx expressions specifically for Ticket
Automation
</p>
<p>
Unlike messaging, there is a lot of content in the email that could just be noise
and adds no value to the conversation for the AI to process. You can however
find
<a href="https://support.zendesk.com/hc/en-us/articles/8357756811162" target="_blank" rel="noopener noreferrer">generic RegEx examples</a>
here too.
</p>
<p>Some examples of this include:</p>
<ul class="ak-ul" data-indent-level="1">
<li data-list-item-id="e39ff110510c03b98c83de480750dffc4">
<p data-renderer-start-pos="14693">
<a href="#h_01GE4BC8Z80B1ZP85N7H54H0NW" target="_self">Signatures / Email Sign-offs</a>
</p>
</li>
<li data-list-item-id="e263bee6bdfcd07dbfb85f2d8b388718e">
<a href="#h_01GE4JJJ5NFJCAEXRPB0ZZY0TF" target="_self">Remove Text After Attachments</a>
</li>
<li data-list-item-id="ee3bff1dd790f4cc0a0b097133417b698">
<p data-renderer-start-pos="14707">
<a href="#h_01GE4JJRC1DQYNH9TT5FK2K8ST" target="_self">Consistent Formatting to be Ignored</a>
</p>
</li>
</ul>
<h2 id="h_01GE4BC8Z80B1ZP85N7H54H0NW">Email sign-offs</h2>
<p>
The end of the email is usually worthless from a content perspective for the
AI agent to infer an understanding of the conversation. Remove/hide everything
after the client has signed off / ended the email. For example "best regards",
"sincerely", " kinds regards" etc. We have a preset that you can add called
<code class="c-mrkdwn__code" data-stringify-type="code">---</code> which takes
the common email sign-offs to remove that text and the subsequent information
which could be the thread of the email, a reply from a newsletter or other post-signature
information.
</p>
<h2 id="h_01H9TJJY12QM1ZHB3TJQ8FVVFM">Remove Text After Attachments</h2>
<p>
Typically images are attached to the end of the email but there may be signature
or policy information. Alternatively, your customers may respond to marketing
communication or a forwarded email and thus those previous/forwarded messages
follow afterward, so it can be better to cancel everything after the attachments
are out from AI processing.
</p>
<ul class="p-rich_text_list p-rich_text_list__bullet" data-border="0" data-indent="1" data-stringify-type="unordered-list">
<li data-stringify-border="0" data-stringify-indent="1" data-list-item-id="eeafec351696c73c52540a32f7537d661">
<code class="c-mrkdwn__code" data-stringify-type="code">Attachment(s)(.|\n|\t)+</code><br>

</li>
</ul>
<h2 id="h_01GE4JJRC1DQYNH9TT5FK2K8ST">Consistent Formatting to be Ignored</h2>
<p>
This could be data from your web forms around whether a user was logged in or
other recurring information at the beginning of the ticket you would like to
ignore. Let's say I have a text that tells me key information about the user
starting with Pages Viewed and then I know all of that fluff ends with a unique
term like Comment, I can hide it with a RegEx like.
</p>
<p>
<code class="c-mrkdwn__code" data-stringify-type="code">Pages Viewed(.|\n|\t)+Comment</code>
</p>
<p>
This can be done in any part of the message as long as unique terms can be determined
and then you can cancel noise at the beginning, middle and end of the message
with this method.
</p>
<h2 id="h_01H9TJJY12M75KDFJPVDF9N1TD">CleanContent mode</h2>
<p>
Ticket noise decreases the success of the intent recognition and with that the
overall performance of your email AI agents. We define ticket noise as any kind
of content that doesn’t include meaningful information to identify the intent,
language, or context of a request. It can be forwarded/replied emails, attached
images, signatures, compliance warnings, etc. When enabled, CleanContent mode
will ensure that only relevant information is used by the email AI agent for
improved intent training and recognition performance. This feature works for
all the languages we support.
</p>
<p>
<span style="color: #1d1c1d;">The CleanContent Mode currently considers attachment entities as ticket noise. For Zendesk users, it is possible to use the CleanContent Mode while still being able to access attachment entities. Here are the few steps to follow in order to set this up:</span>
</p>
<p>
<span style="color: #1d1c1d;">Create a Zendesk trigger to identify and tag emails with attachments.</span>
</p>
<p>
<span style="color: #1d1c1d;"><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/bots_13594727747090.png" alt="Screenshot 2023-08-31 at 16.02.17.png"></span>
</p>
<p>
<span style="color: #1d1c1d;"><span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break">Move the trigger up in the Zendesk hierarchy.</span></span>
</p>
<p>
<img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/bots_13594727753490.png" alt="Screenshot 2023-09-08 at 16.22.03.png">
</p>
<p>
<span style="color: #1d1c1d;"><span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break">In the AI agents workspace, create an AI agent level action that absorbs all the tags.</span></span>
</p>
<p>
<span style="color: #1d1c1d;"><span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break"><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/bots_13594717690130.png" alt="Screenshot 2023-08-31 at 16.01.48.png"></span></span>
</p>
<p>
<span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break">Finally, add a conditional block to the dialogue builder in order to identify if the attachment tag is present or not and set up the needed reply.</span>
</p>
<p>
<span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break"><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/bots_13594727774482.png" alt="Screenshot 2023-08-31 at 16.01.30.png"></span>
</p>
<p id="h_01H9TJJY127REGCZDKRF0086AY">
<span class="c-mrkdwn__br" style="height: 8px;" aria-label="" data-stringify-type="paragraph-break"></span>This
is a newly launched feature that we are still closely monitoring. For that reason,
you can’t activate it by yourself just yet. Please contact your Customer Success
Manager so they can do it for you.
</p>
<p> </p>
<p> </p>

<script id="docs-schema-markup" type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"@id": "https://support.zendesk.com/hc/en-us/articles/8357758835098",
"url": "https://support.zendesk.com/hc/en-us/articles/8357758835098-Using-ticket-automation-RegEx-expressions-for-advanced-AI-agents",
"headline": "Using ticket automation RegEx expressions for advanced AI agents",
"description": "You can use RegEx expressions in ticket automation to filter out irrelevant email content such as signatures, attachments, and consistent formatting noise, improving AI agent intent recognition by enabling CleanContent mode.",
"articleSection": "Customizing advanced AI agents",
"datePublished": "2024-11-11T22:28:20+00:00",
"dateModified": "2025-09-05T23:55:59+00:00",
"inLanguage": "en-US",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://support.zendesk.com/hc/en-us/articles/8357758835098"
},
"author": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"publisher": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"isPartOf": {
"@type": "WebSite",
"name": "Zendesk Help",
"@id": "https://support.zendesk.com/hc/"
},
"about": {
"@type": "SoftwareApplication",
"name": "Zendesk",
"@id": "https://www.zendesk.com",
"softwareAddOn": {
"@type": "SoftwareApplication",
"name": "AI agents",
"@id": "https://support.zendesk.com/hc/en-us/sections/8988994355994"
}
}
}
</script>