How to catch & extract with Regex?

hi,

What’s the good way to extract with regex?

The regex should catch and extract the numbers inside #abc12 #abc50, I would normally use something like #abc(\d+)

I.E.

  • this is 42 and #abc12 because #abc50text:extract with Regex
  • The result will be a list of text with 42 and 50.

Sadly, the way regex work in Bubble doesn’t use the full regex syntax (and this is sad).
Here’s what you can do:
text:extract with regex (regex expression will be: #abc\d+): join with “,”:extract with regex (expression will be \d+)
First step is to output a list of #abcXX and ignore other number. we need to join with because this return a list. A last regex will extract the number from the previous regex.

1 Like

@Jici I understand, thanks !

I wasn’t sure if I had to do two regex (like you explain), or if there was a cleaner way to do it.

Except if you use javascript toolbox or another plugin, I don’t think there’s another way

1 Like

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