What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » php, preg replace help

Pages: (2): « First « 1 [ 2 ] Last »
php, preg replace help
Author: Message:
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: php, preg replace help
quote:
Originally posted by Ezra
But could you gice me something that explains that "/^[a-z]+:\/\//i"
http://php.net/reference.pcre.pattern.syntax

It will match any string that begins with 1 or more letters followed by a colon and 2 slashes. It's also case-insensitive. :p
10-24-2005 02:32 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: php, preg replace help
Exactly(Y)

I'm not sure if there are protocols with other chars then a-z in it, but it supports at least http, https, ftp etc. And if you ever see another protocol, you can always change it;)

Btw:
"/^[a-z]+:\/\//i"

The "main preg" is between / and /
The ^ stands for "begins with";
[a-z]+ is one of more letters
: is a colon
\/ is a /, but should be escaped with a \
\/ is another one
/ is the last / of the preg
i means case insensitive:D
10-24-2005 03:00 PM
Profile E-Mail PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. RE: php, preg replace help
Thanks for the explanation both :)
[Image: 1-0.png]
             
10-24-2005 03:27 PM
Profile PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On