Regex not working in condition for filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 06:16 AM
Hi there!
I'm currently struggling with the condition builder (filter) and a regex. I would like to filter out only a few words from a field. Since there are quite a few, I would prefer to use regex instead of "contains." However, I'm having trouble with it. I've tried several combinations, but none of them work.
For example, this regex: word1|word2|word3 (with "/", with parentheses, etc.). The filter works otherwise, but no regex.
Does anyone have an idea?
Thanks a lot!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 05:56 PM
@Alex1472 This could be the possible explanation.
Here is the link to KB article https://support.servicenow.com/kb?id=kb_article_view&sys_kb_id=0c3d8ec2db6076000e3dfb651f961911
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 06:24 PM
Hello @Alex1472
If there are some things in ServiceNow that can break your trust then regex in condition filter is one.
Anyways, I use regexr website to build regex and below is what I found:
\b(word1|word2|word3)\b
\b is for partial matches like it can find word123
Try using a wildcard pattern as shown below and see if it works for you or not:
.*(word1|word2|word3).*
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 05:19 AM
Hi guys!
Thank you very much! I tried all of this, but it didn't work either. It seems like regex doesn't work at all in the condition builder. I will then go with my original solution.