Help with Regex: match value inside

Hello,

I am trying to extract the error message from this string: {"messages":["This username is already in use. Please try a different username."]}

For this I use the extract with Regex operator with the following expression: "messages":\["(.*?)"] which should work if I am to believe online resources like https://regex101.com/

However, I am not able to extract the match and I get the whole string instead, like so: "messages":["This username is already in use. Please try a different username."]

What am I missing? How can I make the operator return This username is already in use. Please try a different username. ?

I can’t really tell why your example doesn’t work as I struggle to fully understand Regex myself… Not least when trying to run it in Bubble.

That being said, I got your example working using find & replace with a regex pattern matching. Also, note that I added “{” and “}” to the beginning and the end of the regex pattern.

Hope this helps!

1 Like

Hey @data1 a tool I recommend is regex.ai for this kind of stuff. Give it a go!

1 Like

What’s the $1 you’re replacing with?