Debug this RegEx Pattern?

Hi all,
I’ve successfully used ‘find and replace’ with a RegEx pattern as part of my workflow when a new thing is created to remove unwanted bb code in text.
I’m now trying to modify an URL, using a different RegEx pattern, but am not having success. Specifically, i’m trying to replace the text ‘linkedin’ in an URL (case insensitive, at all locations in the URL / not just the first instance), and only when linkedin is not immediately followed by .com. The RegEx pattern i’m using is /linkedin(?!.com)/gi, and when I check it with (or other equivalent regex checker sites), it functions correctly.

When I run this workflow, nothing happens. Does bubble require a different format for this type of RegEx pattern in order to function correctly? I’ve tried dropping the first / from the RegEx, dropping the /gi suffix etc and am still not having any luck. If I just ‘find and replace’ with the plain text linkedin, then the first instance of linkedin in the URL gets replaced, so it seems my workflow is working correctly otherwise.

Any ideas?

when you use regex in bubble you need to input only the pattern, discaard opening e closing /. For example instead of /pattern/ you only use pattern.
There is no control on flags, every regex is applied with a global flag. In your case you can’t use the ignore case flag.

1 Like

you know, when i was looking at some other regex posts to try to figure this out, I saw this regex wizard @dorilama and wondered if I should tag him here, or just sit back and hope for the best. naturally, the legend appears, problem solved. much appreciated. :pray:

shame that the case insensitive aspect doesn’t work but looks like a few other steps in the workflow has it sorted. thanks!

1 Like

This topic was automatically closed after 69 days. New replies are no longer allowed.