Segment - REGEXP Exact Match

Your software
My Mautic version is: v3.2.2
My PHP version is: 7.4.13
My Database type and version is: MariaDB 10.5.8

Your problem
My problem is: Is there a way to do exact matches in Mautic for REGEXP? The issue I have is that we want to add a filter to match only users who have a field with these values AU, CA, GB

However if we add a regexp for (AU|CA|GB) it will also match a user with AUS for example.
There are other parameters that combine with that field, so I know I could do a bunch of OR statements for each match but that makes the segment way more complicated and hard to maintain.

I’ve found this for MySQL/MariaDB that works in the SQL directly but Mautic doesn’t allow it
([[:<:]]AU[[:>:]]|[[:<:]]CA[[:>:]]|[[:<:]]GB[[:>:]])

I can customize it on our side if we need to, but I was wondering if there was already any built in way to do this or not.

As is always the case I found the answer immediately after posting this

A regexp value like this works for me if anyone else is currious
(^AU$|^CA$|^GB$)

1 Like