SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: ereg or preg

  1. #1
    SitePoint Zealot amrknt's Avatar
    Join Date
    Nov 2003
    Location
    india
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question ereg or preg

    I had read the following somewhere in this forum on the topic of email validation:
    it's made with ereg() so it's not the most efficient way but i'm to tired now to translate it to preg syntax
    So I want to know the differences between ereg() and preg. Is the preg superior than ereg.

    thanks to all

  2. #2
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On php.net:

    Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().

  3. #3
    SitePoint Zealot amrknt's Avatar
    Join Date
    Nov 2003
    Location
    india
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BlueFire2k5
    On php.net:


    thanks for ur reply. Is there any drawback using ereg() rather than speed.

  4. #4
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by amrknt
    thanks for ur reply. Is there any drawback using ereg() rather than speed.
    Not that I know/have ever heard of.

  5. #5
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any drawback driving Trabant raher than speed (comparing to mercedes)?

    ereg is slow, low-powered and obsolete. forget it.

  6. #6
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    Is there any drawback driving Trabant raher than speed (comparing to mercedes)?

    ereg is slow, low-powered and obsolete. forget it.
    I agree.

  7. #7
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ereg is an old standard and is still used in unix. pcre is faster and takes up less resources. additionally, it's binary safe. ereg isn't

  8. #8
    SitePoint Zealot amrknt's Avatar
    Join Date
    Nov 2003
    Location
    india
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's enough! taht's what I were looking for. thanx to all.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •