-2
I’m having trouble creating a regular expression that validates the following URL:
https://firebasestorage.googleapis.com/v0/b/nome-app/*
*would be anything!
Someone could give me a related surpote?
-2
I’m having trouble creating a regular expression that validates the following URL:
https://firebasestorage.googleapis.com/v0/b/nome-app/*
*would be anything!
Someone could give me a related surpote?
1
Here’s how you can do it :)
if (a_tua_variavel.indexOf('https://firebasestorage.googleapis.com/v0/b/nome-app/') > -1){
alert("Tem parte do link");
}
Browser other questions tagged javascript java regex dart
You are not signed in. Login or sign up in order to post.
Ask only the tags related to the problem. You want to use regex in Java, Javascript or Dart?
– Sam
For me the logic of regex is Generic... can be in anyone I understand...
– Thiago Cunha
Have you tried that:
https:\/\/firebasestorage.googleapis.com\/v0\/b\/nome-app\/.+
– Sam
It’s actually better to focus on a specific language. Regex varies a lot from one language to another and the solutions are not always the same (in this specific case maybe it is, but it is not always so)
– hkotsubo
@hkotsubo so it is. I even removed my answer because I found mt inconsistent.
– Sam
It would not be enough to see if the string starts with
"http://firebase...etc"
? There it doesn’t even need regex, every language has a method similar tostartsWith
for strings...– hkotsubo