Re: [PHP] Re: using preg_match

2007-05-16 Thread Rob Desbois
[re-sending, forgot to include list :-|] If you're matching a string and not a pattern then it is far more efficient to use strpos: if (strpos($path, '/realtors') !== FALSE) { echo 'Success'; } rob On 5/16/07, Al <[EMAIL PROTECTED]> wrote: The "container", as you called it, are delimiters.

[PHP] Re: using preg_match

2007-05-16 Thread Al
The "container", as you called it, are delimiters. They can be about any character you choose; but, stay away from preg control characters. Personally, I use "%" most of the time. It's a good habit to use delimiter characters that you can be certain will not be included in your strings. Then, y

[PHP] Re: using preg_match to extract information from pop3

2003-03-04 Thread Henry Grech-Cini
Found a solution if (preg_match("/Form:[ ]*(.+)[ ]*<(.+)>/", "Form:Henry <[EMAIL PROTECTED]>", $info)) { print_r($info); } else print "Pattern not found"; but I'm refining it so that it doesn't need the last bit, any more pointers appreciated!!! Thanks All Henry "Henry Grech-Cini" <[EMAIL PR

[PHP] Re: using preg_match to extract information from pop3

2003-03-04 Thread Henry Grech-Cini
I tried if(preg_match("/^From:(.*)$/", $headers[$line], $info)) { echo "["; print_r($info); echo "]"; echo "",HtmlSpecialChars($headers[$line]),""; } But all I get is [Array ( [0] => From: [1] => ) ] From: Henry< henry @ .com > Any pointers? "Henry Grech-Cini

[PHP] Re: using preg_match to extract information from pop3

2003-03-04 Thread Henry Grech-Cini
Hi All, This has to be easy to do using preg_match! Can no one spare a minute of their time? Henry "Henry Grech-Cini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > > I know that you will probably tell me to RTFM but I have (several times) and > I cannot quite understand