I am trying to use the extract with Regex function to extract a string that is always sitting between two strings of texts that never change.
Here are 3 examples
I want {“key”:“1671291382053x721052777787162600”} to return 1671291382053x721052777787162600
I want {“key”:“1671128263833x743710543152935700”} to return 1671128263833x743710543152935700
I want {“key”:“1671128291585x470773579005820900”} to return 1671128291585x470773579005820900
When using this regex pattern {“key”:"(.*)"} with this regex builder (which is recommended in Bubble’s manual), it does return what I need. However, when entering this regex pattern and using the extract with regex function in bubble, the full string is returned, i.e. {“key”:“1671291382053x721052777787162600”}, and not just the part that I need, see below:
Bubble does not expose captured groups and your regex is matching the whole line including what you have before and after the group.
You may want to play with negative lookbehind and lookahead as menrioned in the documentation at the previous link.
Hi there, @42.decaen… this might be hacky, but you should be able to string together Bubble operators to get what you need, and it might look something like this.
It could be a bit easier than what I am showing there, but today I learned you can’t split by a quotation mark. Who knew, eh? (Probably everyone other than me.)
Hey @mikeloc thank you! Yep this works fine but slightly hacky like you said since Bubble might change at some point the number of characters that a unique ID gets, who knows?
PS: I didn’t know that split by quotation mark was not working, good to know!
Hey @lindsay_knowcode Yes this works great! And I checked in Bubble’s manual which confirms that the format of a unique ID follows this pattern: “The unique ID has the format of a long string of seemingly random numbers with an “x” in the middle.”
Thank you!