Regex and dynamic text. A tiny cautionary tale

I use regex operators a lot. Like a LOT. It pretty much is my go-to for all my complex filtering and searching solutions. It runs extremely fast and extremely flexible since it takes dynamic expressions. I use it for the detecting conditionals in the form builders in my Bubble apps.

Anyway the point of this post is to remind myself and any who read this to always remember to escape special characters in your regex expressions. After so many uses I still forget this every once in a while.

4 Likes

How? Would be helpful to see.

The easiest and fastest way I found was use to Toolbox’s expression element to do the conversion using JS.

image

image

2 Likes

ChatGPT never forgets :laughing:

1 Like

It would be good if Bubble.io supported \Q and \E in order to pass strings as is.

1 Like