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.
Recent Topics
Support Nested JavaScript Variables in PageSense Pop-up Targeting
Hello Zoho PageSense Team, I hope you're doing well. I’d like to request a feature enhancement for the PageSense pop-up targeting functionality. Current Limitation: Currently, PageSense pop-ups can be triggered using simple JavaScript variables. However,
Item images
Can we get an "On hover" expanded image for items please ?
Cannot Invert Axis for Rankings
Hi there I want to be able to create a ranking graph in Analytics/BI, with 1 at the top of the Y axis, but I am unable to invert the axis. Super simple example in Excel below. Higher rankings need to be higher up on the graph to give the correct visual
How to copy value from a single line field into a picklist field within a module's subform?
Hello there, I have a single line field in a module's subform. I would like the value in the field to automatically update a picklist field within the same subform (both have items with the same names). Is this possible via function? Unfortunately, workflows
Committed Stock and To Be Received Stock via API?
Is it possible to retrieve Committed Stock and/or To Be Received Stock for an Item via the API? I want to use this information for calculating the amount of inventory needed to be purchased.
Creating Email template that attaches file uploaded in specific field.
If there's a way to do this using Zoho CRM's built-in features, then this has eluded me! I'm looking to create a workflow that automatically sends an email upon execution, and that email includes an attachment uploaded in a specific field. Email templates
Marketer’s Space - Automate a Personalized Holiday Workflow with Zoho Campaigns
Hello marketers, Welcome back to another post in Marketer’s Space! From Thanksgiving through Christmas, you have a flurry of opportunities to connect with your audience. In this post, we’ll see how you can plan an entire month-long automated workflow
Items Below Reorder Point Report?
Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
Zoho Inventory Custom Field Update
Hello All, In this post I am describing how can we Update the Custom Field Value in Zoho Inventory. // Get Org ID orgid = organization.get("organization_id"); // Field Value resvp = ifnull(item.get("purchase_rate"),null); // Record ID iid = item.get("item_id");
Sorting columns in Zoho Projects
Hi, In project management best practice, sorting columns (ascending, descending) is an important tool. Sorting dates to see the order of tasks starting, sorting on priority or even on planned hours is a must for an efficient project control. Currently,
Zoho CRM - Calendar Cards View - Let Users Decide What Is Displayed On Calendar Entries
Imagine planning your week of face-to-face meetings across three counties. You’re trying to group appointments by location to make the best use of your time, but Zoho CRM’s calendar doesn’t show where each meeting is happening. You’re left trying to remember
Explore the Redesigned Quotes Module in Zoho Billing
Dear users, We’re excited to introduce a refreshed look for the Quotes details page in Zoho Billing! This update brings you a more efficient user interface experience without changing your existing workflow. We've enhanced layouts with organized tabs,
Updating custom fields in Zoho Projects
Hi I am wondering if anyone has experience with custom fields in Zoho Projects. I am struggling to update the field using either deluge or the api endpoint. My code is: //custom_Map = map(); custom_Map = {"UDF_DOUBLE_1":"0.27"}; update_Map = map(); update_Map.put("custom_fields",custom_Map.toList());
Zoho Inventory - How to pay a supplier up front then receive multiple deliveries
How do we manage situations where we pay a supplier up front, then the receive the products in increments? Example Workflow: Create Purchase Order > Receive Bill for full amount > Receive Items 2 or more deliveries. Currently, once a Bill is created against
Pin multiple columns and adjust column widths in CRM subforms
Hello all, Subforms act as secondary forms or tables in which you can associate multiple line items to a primary record and thereby ensure more structured and comprehensive data organization. We've made some recent enhancements to subforms. Here's what's
Zoho Books | Product updates | November 2025
Hello users, We’ve rolled out new features and enhancements in Zoho Books. From translating email notification templates to the new transaction locking restrictions, explore the updates designed to enhance your bookkeeping experience. Making Tax Digital
How can I add or change the active customer in Zoho Projects?
I'm trying to change the customer in an active Zoho project. Is it possible to add or change the customer?
Good news! Calendar in Zoho CRM gets a face lift
Dear Customers, We are delighted to unveil the revamped calendar UI in Zoho CRM. With a complete visual overhaul aligned with CRM for Everyone, the calendar now offers a more intuitive and flexible scheduling experience. What’s new? Distinguish activities
Almacenamiento
Hola, Quisiera saber como podría hacer para bajar el almacenamiento de 5gb a mis usuarios, en otras palabras los quiero ir limitando de la cuota real, y luego ir agregando poco a poco la cantidad hasta llegar a los 5gb que me dan en el plan free.
What happens when someone clicks 'unsubscribe' in a zoho CRM email
Hello, As per, i am going round in circles trying to find an answer to these 2 question. I have an email template that has an unsubscribe link in the footer in zoho CRM. First, what happens when someone clicks it - where does the contact get unsubscribed
Nimble enhancements to WhatsApp for Business integration in Zoho CRM: Enjoy context and clarity in business messaging
Dear Customers, We hope you're well! WhatsApp for business is a renowned business messaging platform that takes your business closer to your customers; it gives your business the power of personalized outreach. Using the WhatsApp for Business integration
Zoho CRM - Scheduled Reports Which Contain Chart
Hi Zoho CRM Team, I'm requesting that the Report Export and Scheduling feature be enhanced to include a chart, if one has been created on a report. At the moment I have a report which shows Sales This Week by Deal Owner and a pie chart at the top of the
Ability to Create and Manage YouTube Video Chapters in Zoho Social
Hi Zoho Social Team, How are you? We would like to request an enhancement to Zoho Social that would allow users to create and manage YouTube video chapters directly within the platform. Currently, Zoho Social does not support manually adding chapters
Can I add Conditional merge tags on my Templates?
Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
Cadences
I have just started using Cadences for follow-up up email pipeline. Is it just me or do you find the functionality very basic? For example, it will tell me (if I go looking for it) if someone has replied to a follow-up and been unenrolled; but it won't
Canvas View in Zoho Recruit
Is it possible or would it be possible to have the new 'Canvas View' in Zoho Recruit?
Zoho Inventory - Move Orders
Quick question about Move Orders... Why is there no status to say something like "Draft", "In Progress" and "Completed", similar to Transfer Orders? I'm assuming that when something needs to be moved it should be planned in Inventory, executed and then
Kaizen #215 - Workflow APIs - Part 3 - Create and Update Workflow Rules
Welcome back to another week of Kaizen! Over the last couple of weeks, we’ve joined Zylker Cloud Services as they review and improve their workflows. In Part 1, we discovered and audited their sprawling workflow landscape. In Part 2, we learned how to
DataPrep Bigquery Connection failed
Hello everybody, I want to create a connnection beetwen Bigquery and Dataprep but when I try to connect my project I got this error Loading tables has failed. Table list fetched from the data source expired.
Issue in Zoho People Regularization – Incorrect Hour Calculation
I have noticed that when applying attendance regularization in Zoho People for previous dates, the total working hours are not calculated correctly. For example, even if the check-in is 10:00 AM and check-out is 6:00 PM, the system shows an incorrect
Zoho Analytics Export API
Hi Team, I’m working on some integration tasks and wanted to confirm if it’s possible to retrieve a Zoho Analytics table as JSON data using a Deluge script. I’ve already stored my custom data from multiple sources and combined it into a single source.
Free Webinar : Unlock AI driven business insights with Zoho Inventory + Zoho Analytics
Are you tired of switching between apps and exporting data to build customized reports? Say hello to smarter & streamlined insights! Join us for this exclusive webinar where we explore the power of the Zoho Inventory–Zoho Analytics integration. Learn
Allow Multiple usage units to items while adding them to sales/purchase transactions
The usage unit of items added in zoho books are static right now and can not be changed. But certain items are received or sold in multiple usage units. One example is fabric. It can be bought in Meters, inches, kgs or other units. Another example would
PO receive quantities
At last, Zoho has finally got around to allowing us to receive a larger qty than recorded in the PO :-) Saves us all from editing the PO's before receiving larger quantities ( usual for us ) ! It's still in "beta" but available upon request, I've tested
Invalid URL error when embedded sending url into iframe for my website when using in another region
Hi team, My site is currently working on integrating your signature feature as part of the system functionality, it's working great but recently there's been a problem like this: After successfully creating the document, i will embed a sending url into
Analytics : How to share to an external client ?
We have a use case where a client wants a portal so that several of his users can view dashboards that we have created for them in Zoho Analytics. They are not part of our company or Zoho One account. The clients want the ability to have user specific,
Reference Deal Categories in Deluge
Hello, Is there a way to reference Deal Category in deluge functions? So for our Deals, we have several different WON stages in a pipeline. Rather than type each stage into our functions, we'd like to be able to reference the Deal Category. Similar
Payroll In Canada
Hi, When can we expect to have payroll in Canada with books
Automatic Portal invite
We have numerous customers we move through a blueprint in deals, when they get to a certain point we need to give them portal access, how can this be done through deluge or a workflow?
Users Name & Email in Reports
Hi, I would like to show the Users Name from their Zoho Acount in All Entries/Reports as well as the current Account Email. Thanks Dan
Next Page