RE: [PHP] Problem with regex
| From: | Boget, Chris | Date: | Thu, 13 Jul 2000 21:06:38 +0000 |
| Subject: | RE: [PHP] Problem with regex | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6544@lists.php.net to get a copy of this message | ||
> consider the following code:
> eregi( "<title>.*</title>", $myLine, $titleArray );
> echo $titleArray[0];
> It will work and display the correct dataif the line looks
> like this:
> "<title>Page Title</title>"
> but not if it looks like this:
*sigh*
That's what you get when you post while you are
doped up on pain med. :p
My apologies. I sent this out a little to hastily. My
question should have been with a regex such as:
eregi( "<title>(.*)</title>", $myLine, $titleArray );
Why does $titleArray[0] include the <title></title>
tags? Shouldn't the parenthesis '()' make it so that
it returns only what is between them?
Chris