Regex in Zoho Mail custom filters is not supported - but it works!

Regex in Zoho Mail custom filters is not supported - but it works!

I recently asked Zoho for help using regex in Zoho Mail custom filters and was told it was NOT supported.
This was surprising (and frustrating) as regex in Zoho Mail certainly works, although it does have some quirks*

To encourage others, here are 3 regex examples I created in mail custom filters that have worked fine for me.

Spoiler: I'm not a coder so these examples took me a lot of searching (thanks to others on this site) and tinkering to get the job done — if anyone has improvements on these regex examples, I'm very happy for you to offer them.

Regex examples

1) Purpose: to find all Jpeg, Jpg and Png image urls in email content
regex = "(https?:\/\/[^\s'\"]+?\.(?:jpg|jpeg|png))";

2) Purpose: to find all image urls in email content
regex = '<img[^>]*src="(https?:[^\s,">]*)"';

3) Purpose: to remove unwanted characters in email content, leaving only the urls matched in examples 1 and 2
regex = "\A[\s\S]+?\|\||\|\|[\s\S]+?\||\|\|[\s\S]+?\Z";

Regex explanation and script examples:

1) regex = "(https?:\/\/[^\s'\"]+?\.(?:jpg|jpeg|png))";

(...)                        outer brackets allow match to be captured by variable $1
https?                  ? makes the previous char optional, so matches http or https
:                            literal colon
\/\/                      '\' is required to escape '/' so \/\/, matches '//'
[^...]                      ^ = don't match chars in square brackets
\s                          = white space
'                             = single quote
\"                           = escaped double quote — matches double quote
                               (if i had used single quotes, instead of double, around the whole regex
                                I wouldn't have needed to escape the double quote here)
                              So, [^\s'\"] means match any char EXCEPT white space, single or double quotes
+                           + = match one or more of the chars in square brackets
?                            ? = match the LEAST number of chars (lazy match)
\.                           = escaped dot matches an actual dot (without escape, the dot would match any char except newline)
(?:...)                      ?: = this bracketed group will not be captured by any variable
jpg|jpeg|png         the pipe means 'OR' so this group matches jpg OR jpeg OR png

Script Example
foundUrls = mailContent.replaceall(regex,"||$1||");

Here the $1 variable captures the regex match between (...) so, "||$1||" means 'replace each match with a double pipe and the match, and a double pipe. i.e. place a double pipe around each matched URL.


2) regex = '<img[^>]*src="(https?:[^\s,">]*)"';

'....'                              using single quotes means it's not necessary to escape the double quotes inside the regex
<img                          matches liters <img 
[^>]                            match any character EXCEPT >
*                                 match the chars in the square brackets zero or multiple times
src="                          match literal src="
(...)                              the match inside the brackets is saved to variable $1
https?                        match http or https (? means previous char is optional)
:                                  literal colon
[^\s,">]*                     match any character EXCEPT white space, double quote, chevron — zero or multiple times
"                                  the match must finish with a double quote

NB: the captured variable $1 will only contain the URL from http up to, but not including the final double quote

Script Example

foundUrls = MailContent.replaceAll(regex,"||$1||");

Here, the 'long' URL (<img.. src..."http...) is replaced by the 'short' URL (http....) and surrounded by double pipes


3) regex = "\A[\s\S]+?\|\||\|\|[\s\S]+?\||\|\|[\s\S]+?\Z";

The regex has three options for a match, each separated by a pipe meaning 'OR'

First option:
 \A                  = Start Of File (i.e search from the beginning of the file)
 [\s\S]             matches any white space (\s) and any non-white space (\S)
 +                     + = match one or more of the chars in square brackets
?                       ? = match the LEAST number of characters necessary (lazy match)            
 \|\|                  '\' escapes the pipes so matches '||' (without escape the pipes would be read as 'OR')
 |                       unescaped pipe = OR (i.e. match either first OR second parts of the regex)
 
Second option:
 \|\|                  escaped pipes, so matches '||' 
[\s\S]+?           match any space or non-space one or more times, but use the LEAST chars necessary
\|                      escaped pipe, so matches '|' (NB: when this group is deleted it will leave one pipe between URLs) 
|                        unescaped pipe = 'OR' (ie match second OR third parts of the regex)

Third option
\|\|                    escaped pipes, matches '||' 
[\s\S]+?            match any space or non-space one or more times, but use the LEAST chars necessary
\Z                     = End Of File (i.e. search to the end of the file)

Script example

 cleanUrls = foundUrls.replaceAll(regex,"");

Thus
Option 1: 'StartOfFile up to and including '||' gets deleted.
Option 2: '||' to '|' inclusive gets deleted (leaving one pipe between URLs)
Option 3: '||' to EndOfFile gets deleted

Replacing the single pipes with commas to form a list of URLs is accomplished with:
urls = cleanUrls.toList("|");

NB These scripts use pipes to bracket and separate URLS It's therefore prudent, BEFORE applying the scripts, to remove any existing pipes from the selected text:

regex = '\|';
cleanMailContent = mailContent.replaceAll(regex,"");

* Quirks of Zoho Mail Deluge 

While the scripting language is similar to JavaScript it is not identical and some features of Regex do not work.
In particular, I've not had success using 'lookahead' or 'lookbehind' operations in Zoho Mail custom filters.



    • Sticky Posts

    • Pocket from Mozilla is closing shop. Don’t lose your favorites . Move them to Zoho Mail Bookmarks now! 📥🔖

      The end of Pocket shouldn't mean the end of your important links and content. Easily import them into Zoho Mail's Bookmarks and continue right where you left off. You can bring over your entire Saves, Collections, and tags just the way they are. Bookmarks
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Workplace - Zoholics Europe Customer Awards

      Dear Zoho Mail Community! 📣 We're excited to announce that at this year's Zoholics events across Europe, we're holding customer awards for the first time ever! Workplace - Zoholics Europe Customer Awards This is your chance to shout about the amazing
    • Important update on Group Management | Zoho Mail

      Dear Zoho Mail Community, This post is to inform you all of the following updates on the Group Management in Zoho Mail. Group Member Addition: If a group member is added to an organization group in a Zoho Application, the member will be automatically
    • Mastering email etiquette and best practices to follow in Zoho Mail

      Hello Zoho Mail Community, We’re thrilled to invite you all to our upcoming webinar: Mastering email etiquette and best practices to follow in Zoho Mail. Join our live webinar for expert etiquette tips to enhance your professionalism and elevate your

    Nederlandse Hulpbronnen


      • Recent Topics

      • Duplicating and referencing datasets

        I am moving from PowerBI to Zoho Analytics and while I find Zoho easier to use in many ways, there is one function that I use in PowerBI that I have not been able to find in Zoho.   I have several data sets that I need to modify in different ways to get
      • From Zoho CRM to Paper : Design & Print Data Directly using Canvas Print View

        Hello Everyone, We are excited to announce a new addition to your Canvas in Zoho CRM - Print View. Canvas print view helps you transform your custom CRM layouts into print-ready documents, so you can bring your digital data to the physical world with
      • Zoho Inventory Now Supports VeriFactu for Businesses in Spain

        Starting from January 1, 2026, Spain requires real-time invoice reporting for all B2B transactions. From July 2026, this requirement will extend to B2C transactions as well. All reporting must be carried out through the VeriFactu to AEAT (Agencia Estatal
      • Suggestion: Associating Assets with Company in Zoho FSM

        Hello Team, I would like to share an idea based on practical experience. Currently, all assets in the Zoho FSM Asset module are linked to a specific contact person. I would like to know if it is possible to associate assets with a company instead. This
      • Presenting ABM for Zoho CRM: Expand and retain your customers with precision

        Picture this scenario: You're a growing SaaS company ready to launch a powerful business suite, and are looking to gain traction and momentum. But as a business with a tight budget, you know acquiring new customers is slow, expensive, and often delivers
      • Depreciated mergeAndStore Function Help!

        Hello, I have a function designed to create a PDF containing information from the fields in a Deals record. There is a Writer Mail Merge template in WorkDrive that is populated via Deluge code, and a copy of the resulting PDF is then attached to the record.
      • Why am I seeing deleted records in Zoho Analytics syncing with Zoho CRM?

        I have done a data sync between Zoho CRM and Zoho Analytics, and the recycle bin is empty. Why do I see deleted leads/deals/contacts in Zoho Analytics if it doesn't exist in Zoho CRM? How can I solve this problem? Thanks
      • Employee self-service portal: Onboarding and continuous learning platform for support reps

        Hello everyone, In any organization, employees must go through multiple courses to learn about the product, their organization's standards, and how to respond to customer queries using the knowledge base articles available. This typically requires completing
      • Enhancements to Zoho Map integration tasks

        Hello everyone, We're excited to announce enhancements to the Zoho Map integration tasks in Deluge, which will boost its performance. This post will walk you through the upcoming changes, explain why we're making them, and detail the steps you need to
      • Let’s Talk Recruit: Meet Zia, your all-in-one AI assistant (Part-3)

        Welcome back to the Let’s Talk Recruit series. In the part 2 post, we explored how Zia has evolved with smarter summaries and seamless AI-assisted content creation. This time, we’re diving into the latest upgrades that take productivity even further —
      • AI Interview Insights: Turn Recorded Interviews into Quick Transcripts & Summaries

        Evaluating interviews shouldn’t require replaying long recordings or taking manual notes. With AI Interview Insights, you can now review complete transcripts and AI-generated summaries of your One-way (Recorded) interviews right inside Zoho Recruit. This
      • Announcing Early Access to "Zoho CRM for Everyone" — A new and exciting update to Zoho CRM

        Update : Zoho CRM For Everyone's Nextgen Interface gets an upgrade! Hello everyone, We’ve updated the Zoho CRM for Everyone Nextgen interface based on your feedback. The UI is now simpler with a unified sidebar, a more visible global search and features
      • Unable to verify domain for Zoho People

        I have added TXT records in my DNS (GoDaddy) [screenshot attached], but unable to verify even after 12 hours after adding. On checking the console, it shows some errors [screenshot attached]. It appears that the verification flow is broken - please provide
      • Zoho Invoice Now Supports VeriFactu for Businesses in Spain

        Starting from January 1, 2026, Spain requires real-time invoice reporting for all B2B transactions. From July 2026, this requirement will extend to B2C transactions as well. All reporting must be carried out through the VeriFactu to AEAT (Agencia Estatal
      • Zoho Billing Now Supports VeriFactu for Businesses in Spain

        Starting from January 1, 2026, Spain requires real-time invoice reporting for all B2B transactions. From July 2026, this requirement will extend to B2C transactions as well. All reporting must be carried out through the VeriFactu to AEAT (Agencia Estatal
      • Weekly Tips : Make your email content error free with Spell check in Zoho Mail

        As someone who writes multiple emails a day, we are bound to make both grammatical and spelling errors. Most of them we may not even notice, and even if we do, we may not have the time to correct each one individually when we are in a hurry. So how do
      • Introducing Enhanced Storage Management

        We’re excited to roll out two new enhancements in Zoho Recruit, Subscription Information and Storage Management — designed to give admins complete visibility into subscription details, feature limits, and storage consumption — all from one place inside
      • How to add Product Add-Ons, Mandatory Forms, and Auto-Save Address in Zoho Commerce

        Hi all, I need help setting up several behaviors in Zoho Commerce. I can’t find the correct configuration options, so I want to confirm whether these are supported or if there is a workaround. 1. Product-Specific Add-Ons (Example: GWB Subscription) When
      • how to download all my files

        We are in the middle of zoho docs to zoho workdrive migration. I can not access my zoho docs page. I get redirected immediately to a zoho workdrive page. I would like to download all my files so that I have a backup in case something goes wrong with the
      • Convert Zoho Books SalesOrder - Invoice

        Converting a Zoho Books Sales Order into an Invoice Using the SalesOrder Convert API Hello Zoho Developers, Today, we are sharing a simple and effective solution to convert a Zoho Books Sales Order into a Zoho Books Invoice using the SalesOrder Convert
      • Zoho Expense - Report Templates

        Hi Expense Team, I do a recurring trip once every week which has the same cost: Per diem Milage Toll Payment It would be great if there was a feature which allowed me to clone a previously submitted report or create a template reports. This would save
      • How to add tabular data when execute Add Record API

        Hi everyone! I was send api updateRecord follow by this request url : https://people.zoho.com/people/api/forms/json/<formLinkName>/updateRecord with parameters "inputData", "tabularData", "recordId". Ex picture below And response success: But. When I
      • Tip #51- Centralized Contact Management for Better Remote Support- 'Insider Insights'

        For our final topic of November, we’re diving into one of the most helpful features in Zoho Assist, the Contacts section on Zoho Assist;s dashboard. Whether you’re managing multiple clients, tracking past sessions, or simply looking to streamline your
      • Using gift vouchers

        We would like to be able to offer a limited number of gift vouchers, of varying values, to our customers, and are looking for the best way to do this. We have looked at Coupons and Gift Certificates, but neither seem to fit the bill perfectly. Coupons:
      • CRM Related list table in Zoho analytics

        In Zoho Analytics, where can I view the tables created from zoho crm related lists? For example, in my Zoho CRM setup, I have added the Product module as a related list in the Lead module, and also the Lead module as a related list in the Product module.
      • Option to Customize Career Site URL Without “/jobs/Careers”

        Dear Zoho Recruit Team, I hope you are doing well. We would like to request an enhancement to the Career Site URL structure in Zoho Recruit. In the old version of the career site, our URL was simply: 👉 https://jobs.domain.com However, after moving to
      • Zoho CRM for Everyone's NextGen UI Gets an Upgrade

        Hello Everyone We've made improvements to Zoho CRM for Everyone's Nextgen UI. These changes are the result of valuable feedback from you where we’ve focused on improving usability, providing wider screen space, and making navigation smoother so everything
      • Say Hello to Telephony in Zoho FSM

        Zoho FSM now brings complete telephony support so your team can manage inbound and outbound calls without switching tabs. Faster responses, smarter routing, and total call visibility—all in one place. Choose the telephony setup that works for you Zoho’s
      • Zoho Sign - Zoho CRM extension upgrade

        Hi everyone, We've updated Zoho Sign extension for Zoho CRM with significant internal changes. Impact on existing Zoho Sign extension users Users using the extension without customization If you are using the integration without implementing Zoho Sign's
      • Is there a way to create a desktop shortcut for a website course portal?

        Hello everyone, I recently got a laptop and bought an online course from a website, Skillwint.com, which I visit regularly. I open that site many times a day and want to create a desktop shortcut so I can open it directly instead of searching in the browser
      • Managing functions

        Can someone let me know if there are any plans to improve the features for managing functions in CRM? I have lots of functions and finding them is hard. The search only works on the function name and the filter only works on function type. I have created
      • Sent mail sort by date disappeared

        Hello, We used to be able to sort the emails by date in the sent folder, but this feature has recently disappeared. Can we bring it back?
      • When will it be possible to edit Subform records via either views or tabular reports?

        Hey there, data maintenance often requires mass update of quite a lot of records. While this is a piece of cake via either List view or Zoho sheet view, the same cannot be carried out for subform records yet. When one of the two options will be made available?
      • E-Invoicing in Belgium with Zoho Books

        Starting January 1, 2026, Belgium is introducing mandatory electronic invoices (e-invoicing) for all B2B transactions between VAT-registered businesses. This means that invoices and credits notes must be exchanged in a prescribed digital format. How E-Invoicing
      • E-Invoicing in Belgium with Zoho Inventory

        Starting January 1, 2026, Belgium is introducing mandatory electronic invoices (e-invoicing) for all B2B transactions between VAT-registered businesses. Invoices and credits notes must be exchanged in a prescribed digital format. How E-Invoicing Works
      • Employee ID is not correct in get records api V2 for leave

        Hi Team, We are facing an issue when calling the Get Records API V2. The employee.id returned in the response is not the actual employee record ID in Zoho People. As a result, our integration is forced to make an additional Get Record API call for every
      • Formatting Mailing Labels

        I want to use the "Print Mailing Labels" function on the drop down list, but I am not seeing a way to change the formatting on the mailing labels. At the moment, the information that appears on the mailing labels ARE NOT mailing addresses, but random
      • Zoho People. Updating TabularData

        I am trying to update tabular data in the record. I always have the same response. I have checked many times. Section ID is correct. May be something wrong with request structure itself. Can someone help me. Body content type: form urlencoded query params
      • Canvas View - Print

        What is the best way to accomplish a print to PDF of the canvas view? Latest update (27th November 2025): We are excited to announce that the Canvas Print View is now available! We encourage you all to try it out and share your feedback with us. Learn
      • New to automation - please help

        Hi there! We are new to automations in Zoho. We built out one automation campaign and it seems to be firing off for some people but others not. Please advise what's the best practice or if anything we should tweak. Thank you so much!
      • Next Page