You are here: Re: [PHP] Regex help « PHP « IT news, forums, messages
Re: [PHP] Regex help

Posted by Dotan Cohen on 10/04/41 11:23

On 8/4/05, Lizet Pena de Sola <mailinglist@theniceweb.com> wrote:
> Ok, it's not the regexp for detecting email addresses what I need,
> that's widely published, thanks. I'm using ereg to match this regular
> expression:
>
> (On)[\s\w\d\W\S\D\n]*(wr[i|o]te[s]?:)
>
> That will match phrases like
> "On 8/3/05, Carol Swinehart <cshart@greenapple.edu> wrote:"
> the type "On date, name <email> wrote or writes:"
>
> The thing is I tried this regexp with Regex Coach and it matches fine,
> but ereg returns no match
>
> ereg($regexpstr, $str, $regs)
>
> I know there are some comments at php.net about how ereg has some bugs,
> any idea if this could be one?
>
> Tia,
> Lizet

You're not going to get far with that. Lots of people make 'funny' You
Wrote lines, and not all of them start with 'On' or contain the word
'wr[o|i]te'. You might be better off just searching for any sentance
that contains an @ sign, because they are very seldom used outside of
email addresses nowadays. And that doesn't make any promises, either,
because sometimes the whole email address isn't in the line, just the
person's name.

Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/286/judas_priest.php
Judas Priest Song Lyrics

 

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

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