Regex in event rule not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2023 10:27 PM
I am trying to write a event rule. I need to filter it on the basis of event description. If the description dose not contain IP address then this rule should execute.
Regex is : .*^(?!.*\b(?:\d{1,3}\.){3}\d{1,3}\b).*
I validated this on https://regex101.com/
But the rule is executing in both the conditions. Please guide.
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 07:29 AM
Hi @Rahul Priyadars : Did you get time to check this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 07:56 PM
Try this
^([^0-9]*)$
Happy use Case-
_ve Use case-
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 01:17 AM
This will fail even if there is any number in the description containing any number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2023 11:54 PM
HI @pratiksha5 ,
I trust you are doing great.
I am trying to write a event rule. I need to filter it on the basis of event description. If the description dose not contain IP address then this rule should execute.
Regex is : .*^(?!.*\b(?:\d{1,3}\.){3}\d{1,3}\b).*
I validated this on https://regex101.com/
But the rule is executing in both the conditions. Please guide.
Reference code
(function executeRule(current) {
var eventDescription = current.description; // Assuming the event description is stored in the 'description' field
var ipRegex = /^(?!.*\b(?:\d{1,3}\.){3}\d{1,3}\b).*/;
if (!eventDescription.match(ipRegex)) {
// Your code logic goes here
// This code block will be executed only if the event description does not contain an IP address
}
})(current);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 01:12 AM
Hi, I do not need a script for validation. I am doing validation in the regex101.