Connecting Tech Pros Worldwide Help | Site Map

Searching for a pattern

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:30 AM
Sven Dzepina
Guest
 
Posts: n/a
Default Searching for a pattern

Hello,

Has somebody a pattern which contains:
- URL Checking (This Syntax: http://www(with and without www).lol.com
- Only *.html, *.htm, *.php formats - also: http://www.lol.com/index.html or
index.htm or index.php.

Thanks.

Gretting!



  #2  
Old July 17th, 2005, 12:30 AM
Alan Little
Guest
 
Posts: n/a
Default Re: Searching for a pattern

Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain:
[color=blue]
> Has somebody a pattern which contains:
> - URL Checking (This Syntax: http://www(with and without www).lol.com
> - Only *.html, *.htm, *.php formats - also:
> http://www.lol.com/index.html or index.htm or index.php.[/color]

Do you mean something like this:

^http://(www\.)?[A-Za-z0-9-]+\.[A-Za-z0-9-]{2,}/?$

For full, proper URL validation, you'll have to go beyond a single
expression. I suppose it might theoretically possible to do it with just
a single expression, but I think people try to cram too much into
regexes, rather than breaking things down a bit.

It just so happens I recently wrote a URL validation plugin for Phorm.
You're welcome to extract the URLVal function from it and use it.

http://www.phorm.com/plugins.php3

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
  #3  
Old July 17th, 2005, 12:31 AM
Sven Dzepina
Guest
 
Posts: n/a
Default Re: Searching for a pattern

Hello Alan,

Your pattern can not help me. =(
Has somebody another idea?

Gretting.

"Alan Little" <alan@n-o-s-p-a-m-phorm.com> schrieb im Newsbeitrag
news:Xns941292B0E57B6alanphormcom@216.196.97.132.. .[color=blue]
> Carved in mystic runes upon the very living rock, the last words of Sven
> Dzepina of comp.lang.php make plain:
>[color=green]
> > Has somebody a pattern which contains:
> > - URL Checking (This Syntax: http://www(with and without www).lol.com
> > - Only *.html, *.htm, *.php formats - also:
> > http://www.lol.com/index.html or index.htm or index.php.[/color]
>
> Do you mean something like this:
>
> ^http://(www\.)?[A-Za-z0-9-]+\.[A-Za-z0-9-]{2,}/?$
>
> For full, proper URL validation, you'll have to go beyond a single
> expression. I suppose it might theoretically possible to do it with just
> a single expression, but I think people try to cram too much into
> regexes, rather than breaking things down a bit.
>
> It just so happens I recently wrote a URL validation plugin for Phorm.
> You're welcome to extract the URLVal function from it and use it.
>
> http://www.phorm.com/plugins.php3
>
> --
> Alan Little
> Phorm PHP Form Processor
> http://www.phorm.com/[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.