REGEX without commas

I’m hoping that someone can help with this. I’m using REGEX to extract the first letter of each word and I want the result to be a string, not a comma separated list or a string with spaces between the letters.

Previous responses to this question pointed to websites that can help with evaluating expressions but I don’t need help with the expression, I have the expression that I need. What I’m hoping for is help defining the result as Bubble handles it. None of the websites suggest that the result would be a comma separated list, but Bubble seems to think this is what we want. How do I remove the commas?

Something like that :

\b(\p{L}|\p{N}+)

Thanks but I’m sorry…Can you help me make sense of that expression? This seems to be matching specific letters, like P and L and N, and I can’t understand what the outcome is supposed to be with that. I don’t see how this will remove a comma and a space from the result that Bubble presents.

To clarify:
Starting with a two word string, “Cityside Huntington” for instance, I’m looking to get a result of “CH”. What I’m getting is “C, H”. I’m using the regex string expression “\b[A-Z]” to extract the first characters of the two words in the string but Bubble insists on returning a comma separated list. I’ve tried a find/replace with the regex but that does absolutely nothing.

1 Like

Bubble return a list, but you can use :join with and leave it empty

1 Like

The :join with/empty leaves me with an error so I used a space instead to join with. This eliminates the stupid comma and looks a little better. I just wasn’t able to find a way around the error without giving Bubble something to join with.

Are there any methods for using a non printing character that I could enter?

Didn’t think about the join it cannot ignore the empty value… Maybe you can join with | and after use :find and replace. Find and replace will allow you to leave the replace empty

Or try to copy the empty character from a site like:
https://emptycharacter.com/

3 Likes

Thank you, the :join with using the empty character worked great.

image

2 Likes

Another idea you could use is to buy my Alphabet Advanced Avatar plugin :stuck_out_tongue:
It would have done it all for you :wink:
But I was not sure what you was trying to do

Although I am happy with the solution you helped me with, I’m always open to supporting plugin developers so of course I’ll subscribe.

Thank you!

1 Like

You’re welcome!