You are here: Re: Newbie needs help with ereg regular expression « All PHP « IT news, forums, messages
Re: Newbie needs help with ereg regular expression

Posted by Captain Paralytic on 02/16/07 12:15

On 16 Feb, 12:06, raj <r...@nospam.com> wrote:
> On Fri, 16 Feb 2007 11:59:27 +0000, Captain Paralytic wrote
> (in article <1171627167.523089.186...@m58g2000cwm.googlegroups.com>):
>
>
>
>
>
> > On 16 Feb, 11:55, raj <r...@nospam.com> wrote:
> >> Hi,
>
> >> I have to repost this to restate the question. No disrespect to the original
> >> reply.
>
> >> Please can someone help regarding providing a regular expression for
> >> entering
> >> a set of characters with letters, numbers, periods (.), hyphens (-), or
> >> underscores (_) only.
>
> >> I need to do this using ereg
>
> >> I've got as far as this but it doesn't quite work:
>
> >> $pattern="^([a-z0-9.-_]{0,30})$";
> >> if(ereg($pattern,$_SESSION['id']))
> >> ...
>
> >> Thank you in advance.
>
> >> Kind regards,
>
> >> Raj (newbie)
>
> > As a matter of interest, why does it have to be done using ereg rather
> > than say, preg_match?
>
> It's for 2 reasons
>
> 1. Be consistent throughout the site
> 2. I will disable preg_match and some other unused functions.
>
> Any help with providing the ereg answer would be greatly appreciated.
>
> Kind regards,
>
> Raj- Hide quoted text -
>
> - Show quoted text -

Sheesh, what terrible reasons. the php manual itself advises the use
of perg_match over ereg for efficiency.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация