SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 48 of 48
  1. #26
    giorgio
    SitePoint Community Guest
    Excellent article, easy to understand, right to the point - thanks a lot!

  2. #27
    Tucker
    SitePoint Community Guest
    Amazing article. I've been completely confused about ereg and now I can finally code my registration page!

  3. #28
    Simi Rajesh
    SitePoint Community Guest
    Very useful article. It is really simple and easy to understand. Thanks!

  4. #29
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice article,,, specially for
    begginners...Thanks!!!

  5. #30
    SitePoint Member Fr0zen2k6's Avatar
    Join Date
    Sep 2006
    Location
    Chicago
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great article, thanks!

  6. #31
    Jeffrey
    SitePoint Community Guest
    Whats to stop someone entering blah@@blah.com

  7. #32
    Goose
    SitePoint Community Guest
    Great article, explains the problem and solution very well. I would add something extra about the {2,4} rule though as there are TLDs that are valid and longer so it may provide problems for certain user groups

  8. #33
    Phil
    SitePoint Community Guest
    Why do you put a period in the brackets for the extension part (on the first page): [a-zA-Z.]{2,5}$

  9. #34
    Edson Medina
    SitePoint Community Guest
    you could use \w instead of a-zA-Z0-9_

  10. #35
    SitePoint Enthusiast fractaldimension's Avatar
    Join Date
    Jul 2006
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This regex will validate the following email address:

    ----_____.......@___---......xx

    Maybe it could be rewritten to be a bit more complete? Actually, I haven't checked the rfc: is the above a valid email address?

  11. #36
    John
    SitePoint Community Guest
    thanks this was very helpful! before i avoided regex like mad but now i see its very useful!

  12. #37
    PeterSpoon
    SitePoint Community Guest
    How about email addresses containing subdomains. Like:
    xxx@yyy.zzz.com
    e.g. xx@yy.gov.pl

  13. #38
    mistap
    SitePoint Community Guest
    Clear, concise article that helped me gain a basic grasp on regex. Thanks a lot!

  14. #39
    Sam
    SitePoint Community Guest
    Why do you use a-zA-Z since eregi is not case sensitive?

  15. #40
    Niru
    SitePoint Community Guest
    This article helped me alot. Thanks.

  16. #41
    Michael
    SitePoint Community Guest
    Some email addresses have a + sign in their username. I cannot seem to get the script to work if I ad the plus sign in that area?
    IE eregi('^[a-zA-Z0-9._-+]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$', $email)

  17. #42
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael View Post
    Some email addresses have a + sign in their username. I cannot seem to get the script to work if I ad the plus sign in that area?
    IE eregi('^[a-zA-Z0-9._-+]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$', $email)
    Hyphen (-) has a special meaning if not at the beginning or end of a character class so you shouldn't add the plus after the hyphen. You should add it anywhere else to keep the hyphen at the end:

    PHP Code:
    eregi('^[a-zA-Z0-9._+-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$'$email

  18. #43
    ilyas khan
    SitePoint Community Guest
    it improve the knowledge of the students.

  19. #44
    afroxav
    SitePoint Community Guest
    Your tutorial doesn't cover domains such as co.uk where you have both a TLD and a 2LD. Or gTLD such as museum or travel.

  20. #45
    Sommy
    SitePoint Community Guest
    The eregi function is history. PHP6 delete this, onli will work the perl reg exp...

    Bye!

  21. #46
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs down

    This script is extremely outdated.

  22. #47
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice article. But I have a problem. How do I match a sentence under a quotation? For example, if the text is

    I need you help to 'get sentence under it'. Pleas help me.

    Look at above text. I need to match the sentence which is under the single quotation. Please help me by providing appropriate regular expression.

  23. #48
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,023
    Mentioned
    210 Post(s)
    Tagged
    1 Thread(s)
    hkabir, this article is very old (although you may not realise it) and it would be better if you asked in the PHP forum.

    Yet, I will simply tell you that if those single quotation are part of the text you need to look for, you simply escape them with a backslash.

    As an example, you have this sentence

    Code:
    $string="This is a very 'simple sentence' with a bit of text."
    and you want to look for the string 'simple sentece' with which includes those single quotes.

    Code:
    eregi('\'simple sentence\' with', $string)
    Eregi is a function that now is deprecated fo, there is an extension called PRCE based on perl and regular expressions, of course


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
  •