top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: Match That Regular Expression
eXemplar
Posts: 910
Location:
I'm after a decent regular expression which will match almost any mainstream protocol, along with user and/or password + ports with subdirectories.

I've been lookin on google for a bit, because I saw one that was a few hundred characters in length(at least), but I must've removed the link from my bookmarks, and can't seem to find it.

Anyone know ?
system
--
whoop
Posts: 7893
Location: Brisbane, Queensland
wtf? is this mysql queries or something?
brett
Posts: 1672
Location: Sydney, New South Wales
^:\/\/$ will match *://* - thats all protocols (?)
James
Posts: 41
Location: Brisbane, Queensland
more info please dude...
brett
Posts: 1673
Location: Sydney, New South Wales
oh i had to read the rest of it, use explode(":", string) to get the user/pass.

if its always protocol://blah:blha@hostname.com:port/blah/blah
exp[0] is the protocol name, remove("\/\/", exp[1]) == user, remove("@", exp[2]) == pass,

bah i cant be bothered to keep explaining, you get the idea. explode/str_replace is all you need.
scuzzy
Posts: 10967
Location: Brisbane, Queensland
http://www.regexbuddy.com/
spidz
Posts: 8321
Location: Brisbane, Queensland
aint over till the fat lady sings


^^ thats a regular expression.
eXemplar
Posts: 911
Location:
teq, yes, that would match all protocols, but not if they were missing the protocol information (ie, assumed http).

Doesn't matter, I have one that will match, but fails on some. Still, if anyone knows of this uber regexp, gimme a buz.
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.