Thank you for your help on this!
I’m not exactly sure what this means. Can you share more?
And would the text of the regex in the post above help with doing this?
Thank you for your help on this!
I’m not exactly sure what this means. Can you share more?
And would the text of the regex in the post above help with doing this?
Don’t listen to that person. All we need is what goes in and what comes out.
@keith I was looking for the inputs and the regex tried as text.
I think I got a pretty solid combination. →
(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+
You can add in the box real data to see if it gives you back the specifics.
This is a specific regex for Safari safari test - Regex Tester/Debugger
It will even tell you the issues with the other one
This one may help, catchs all starting with https, http, www. , file, ftp. But wont get hello.net or hello.com
/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/igm
Do you know how I might get this working in Bubble?
@WorkWithJordana is this what it is suppose to look do and look like?
If yes I’ll send the script in text and maybe you could use a toolkit plugin action as intermediary
Sorry I took it it to code, couldn’t think of it in another way.
It’s not clear how I make this workable in Bubble.
Can you provide more details?
@WorkWithJordana did you not build it?
Hi Keith! Yes, I’m still not clear on the recommended solution.
It sounds like the regex would have to be conditional based on the user’s browser.
And for users on Sarafi the regex would be:
(?:(?:https?|ftp)://)?[\w/-?=%.]+.[\w/-&?=%.]+
Replaced by the same output as in the case of the Android/PC expression.
Can you hep me understand what is meant by “use the toolkit plugin action as an intermediary”? Happy if this is a solution, just want to make sure I’m not misunderstanding how to apply it in Bubble or what is meant.
Yup, @keith… your second reply in the thread is what clued me in on what to search for.
The reason I linked to that thread is because it has a suggestion for how a regex might be modified to work in Safari, and I thought that might help.
Sorry, @WorkWithJordana… I had to leave my computer right after I sent that reply (and I’m going to be away for a while), so I wasn’t able to dig in any further.
No worries, Mike! You got us on the right track
I think it’s almost solved, just looking for a plugin to help determine which browser a user has, if that’s the best approach. Found this so far:
@WorkWithJordana the regex: (?:(?:https?|ftp)://)?[\w/-?=%.]+.[\w/-&?=%.]+
will work for all cases, not just for safari. You can use it for android, ios and the rest as it was plan before with the same logic. No need to detect device and set conditionals.
I got confused with the formating thing and thought you needed that as well. Forget all the coding and javascript, sorry about that.
Have you already tested changing the old regex with this one?
Ooooh, I see! That would be the ideal solution
I did try to enter that expression into the Bubble regex find and replace (I’m on a PC) and it didn’t seem to work. But if that works for all devices you would be a life saver!
I’m wondering why it doesn’t work when when I enter it in? Let me try again to double check.
@WorkWithJordana Not sure, you can try it like this (added / at start and /igm at the end)
/(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+/igm
That doesn’t seem to work either, it’s so strange. This is what the links look like with that regex. They’re not clickable now at all.
I’m wondering if sometimes regex works in the browser simulators but there’s something about Bubble that makes the regex that works in simulation not always work in reality in Bubble?
But I feel like we’re getting closer to the solution!
I’m wondering if it could be the case that this regex only works on Safari (I’m on PC):
(?:(?:https?|ftp)://)?[\w/-?=%.]+.[\w/-&?=%.]+
…because it makes the text boxes disappear completely, like described by my users on iPhones when I used this regex that works fine on Android and PC:
((https?://)?((?:www.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9].[^\s]{2,}|www.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9].[^\s]{2,})|(https?://)((?:www.|(?!www))[a-zA-Z0-9]+.[^\s]{2,}|www.[a-zA-Z0-9]+.[^\s]{2,}))(?<!.{3})
NOTE: first minute had a typo on regex shared, I’ve edited
@WorkWithJordana seems chrome has issues with the backslash.
give this one a try, worked on both regex101.com and safari test - Regex Tester/Debugger
/(?:(?:https?|ftp)://)?[\w-?=%.]+.[\w-&?=%.]+/igm
I don’t know why it doesn’t seem to be working on my PC when I enter this regex into Bubble. But I feel like we’re right on the edge of finding the solution! Thank you so much for your help on this.
Did it work when you entered it into Bubble by any chance?
@WorkWithJordana I’m off for the day. Maybe @mikeloc @keith someone can give it a shot with the new regexs.
Okay, thanks! Hopefully there’s a solution that’s workable in Bubble.
For any future Bubblers with this challenge, here is what I know so far of the solution:
iOS / Safari doesn’t like this regex (it works fine everywhere else; e.g. Android):
((https?://)?((?:www.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9].[^\s]{2,}|www.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9].[^\s]{2,})|(https?://)((?:www.|(?!www))[a-zA-Z0-9]+.[^\s]{2,}|www.[a-zA-Z0-9]+.[^\s]{2,}))(?<!.{3})
I used a device detector plugin to successfully detect which users are on Android etc vs. iOS devices
I’m giving the non-iOS users the regex that successfully works for them above. The only missing piece is the equivalent regex that works for iOS users, which I will be giving to iOS users only as a conditional using the device detector plugin.
Edited: Found the iOS regex that works!
Thanks for pushing the needle on getting closer to the solution, everyone!