Regex help. This is working on <regex101.com> (her...
# support
d
Regex help. This is working on regex101.com (here's the link:https://regex101.com/r/Rt773n/1) but it appears that signoz doesn't like it. How can I find out why?
1
I got the regex from signoz AI chat bot 🙂 It appears to be correct in the regex101 test environment
Copy code
(?i).*(chrome|firefox|safari(?!.*chrome)|edge|opera|internet explorer|msie)
v
Please try using python style named capture groups
(?P<TYPE>\[(.*?)\])
instead of
(?<TYPE>\[(.*?)\])
- Note the use of ?P instead of just ?
d
I haven't used those before. Is this converted correctly?
Copy code
(?i).*(?P<string>chrome|firefox|safari(?!.*chrome)|edge|opera|internet explorer|msie)
It works in regex101, with python flavor selected
v
Does it work while simulation in signoz?
d
I don't know what the simulation area is. I have got it to work, by adding a name to the negative lookahead group too:
Copy code
(?i).*(?P<browser>chrome|firefox|safari(?P<s>!.*chrome)|edge|opera|internet explorer|msie)
Thank you for helping me out!
🙌 1