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, you
[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.
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 it!
I tried
if(preg_match(/^From:(.*)$/, $headers[$line], $info))
{
echo [;
print_r($info);
echo ];
echo PRE,HtmlSpecialChars($headers[$line]),/PRE;
}
But all I get is
[Array ( [0] = From: [1] = ) ]
From: Henry henry @ .com
Any pointers?
Henry Grech-Cini [EMAIL
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 PROTECTED]
5 matches
Mail list logo