I continue to have problems with using REGEX_EXTRACT in custom properties... here's the regex that I built to strip away the trailing part of a url (you can see it working) and how I used it mixpanel, but something is clearly wrong; last time I had trouble with escaping characters properly, but this is valid PCRE, so if that's the case it means that Mixpanel is not, in fact, using PCRE?
Vlad S. not sure what you mean when it's clearly wrong. What is it not doing? I have used this as a custom property to get the based domain without any parameters.
REGEX_EXTRACT(@"""{"label":"Current URL","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$current_url"}"""@,"[^?#]+",0)
So the regex is [^?#]+
how is it wrong? and if it's wrong, why does it work in regex101?
to be clear, I expect the output to be the first part of the url (what's in the green in the first screenshot) but I just get (not set) in Mixpanel
I'm not saying your Regex is wrong. I'm asking what is wrong about it. what is not working (can't tell from your images)
ohhh... yeah, it just doesn't extract anything
when I did this:
REGEX_EXTRACT(@"""{"label":"Current URL","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$current_url"}"""@,"(.*?)\/*([?].*)?",0)
which I think is a copy of yours, I agree I get no results. But I think you are missing the ^ and the $ in what you put in.
REGEX_EXTRACT(@"""{"label":"Current URL","propertyDefaultType":"string","resourceType":"event","type":"string","value":"$current_url"}"""@,"^(.*?)\/*([?].*)?$",1)
that is returning results.
𤌠thanks, let me give it a try!
yep, user error đ
thank you!
đ¤