14 comments

0

Does anyone know if a perfect regex URL validator exists? There's one in the article I posted that passed all but one test, which makes me wonder if it's even possible.

0

Valid characters in DNS request specification. That's it.

If you want to define a DNS response for "server" then "server" is now a valid URL.

0

The regex part is what I'm interested in. As you can see from the link (or do a search), it's tough to find a 100% failproof regex pattern.

0

You didn't even specify what type of regex. Since it's possible to have a url that validates but doesn't exist or is otherwise unreachable, I'm at a loss for why anyone would care unless you run a registrar.

0

lol why validate user input at all? Unless you run a registrar.

0

A normal person would validate that it doesn't overflow or otherwise break their code.

A shitty programmer would sperg out about how to make a single perfect line that still fails anyway, and not even realize not every regular expression feature works the same or is supported in every implementation of regular expressions.

0

wHy Do YoU eVeN nEeD tO VaLiDaTe?

0

Actually I'd like to see you offer a reason that isn't nullified by "not all possible DNS entries exist".

You don't get to use overflows or other escapes as an excuse, I already mentioned those.

0

Seriously man, you fucking lost and now you're trying to save face, and you're doing so doubling down on your retardedness. How stupid can you get? Just take the L and go home, you don't know what you're talking about.

0

You didn't realize "regular expression" and even "PCRE" means something slightly different in almost every language until just now did you?

0

Oh no, you're retarded.

Go back to building "Hello World"s.

0

Says the guy who made no attempt at his own problem and couldn't even contrive a case where it would matter.

No less than I'd expect from a web developer. Don't you have to go import another 400 libraries so you can copy/paste one more function or something?

0

To clarify, I’m looking for a decent regular expression to validate URLs that were entered as user input with.I also don’t want to allow every possible technically valid URL — quite the opposite.

WTF is this idiot even saying?

0

LOL I read that and didn't understand it, either.