Hi,
I’ve created a regular expression in JavaScript to capture all words beginning with ‘@’.
I’ve tested it on regex101.com and it works.
However, when I paste it into Bubble it doesn’t seem to be working.
Please take a look at the below screenshots.
In this case, I would like ‘@Billy’ to be replaced by ‘!’
remove first and last /
and any flag.
Bubble execute any regex with a global flag and whats only the pattern without the surrounding slashes.
Cheers
Mariano
1 Like
The any flag is - \ ?
Right now, I’ve got this ‘@w+g’ but it’s not working.
Thanks for the comment
No, is not. The flag is the g
at the end. More details here
You are literally searching for text that has @
followed by one or more w
followed by g
As I said you need to remove the leading /
, the last \
and anything after.
Eg. instead of /asdf\w/g
input asdf\w
Gotta still have the + at the end.
@\w+ was the solution in this case.
Thank you very much.
system
Closed
6
This topic was automatically closed after 70 days. New replies are no longer allowed.