Hi All,
I am trying to use regex to catch some specific email address while excluding some and seems regex negative lookahead is not working in FortiMail. Can anyone confirm that or me just doing it wrong?
My regex is to search in header with line "start with from:" and end with "example.com", but ignore anything from @support.example.com
(?!^from:.*@support\.example\.com$)(^from:.*example\.com$)
Thanks a lot.
Brian
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
brian.li wrote:Try /^from:.*example\.com$/Hi All,
I am trying to use regex to catch some specific email address while excluding some and seems regex negative lookahead is not working in FortiMail. Can anyone confirm that or me just doing it wrong?
My regex is to search in header with line "start with from:" and end with "example.com", but ignore anything from @support.example.com
(?!^from:.*@support\.example\.com$)(^from:.*example\.com$)
Thanks a lot.
Brian
Starts with "from:", ignores an unlimited amount in the middle, ends with "example.com". I escaped the dot in .com so it won't match any character in that space.
** Added: I just saw the second half where you already did that. Sorry not able to add more information. Not sure if Fortimail uses standard regex, but try square brackets instead? And use the pipe between. i.e.
[?!^from:.*@support\.example\.com$|^from:.*example\.com$]
This would equate to not matching on the first half or matching the second half.
Hope that helps.
Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1702 | |
1092 | |
752 | |
446 | |
228 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.