Regular expressions
| From: | Mircea Romanitan | Date: | Mon, 26 Mar 2001 14:29:17 +0000 |
| Subject: | Regular expressions | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-7815@lists.php.net to get a copy of this message | ||
Hello all.
Can anyone tell me where i can find some detalied help about regular expressions used at ereg,
eregi, etc ?
For example i have this string:
<html>
<head>
<meta name="keywords" content="poli, easjkdha, owersweoihjwe,
uitsodgfisdgisdiv">
<meta name="description" content="aaaaaaaaaaaaa, wwwwwwwwwwwwwwwwwwww,
wereeeeeeeeeee, rrrrrrrrrrrrr">
<title>osdfjsoidiid werioeiorigfs dfv sdfvo sdivvhdoososos </title>
</head>
<body>
siodfhyusiodfusdfjkdjfskodjfdjfsdkljfskldjfsd
sdfskdjfhksdjfhskldsldkjfsldkfjsldkfjsldkfjsdf
<a href="aaaaa.php">some web page</a>
</body>
</html>
then i have this:
eregi("<META NAME=\"keywords\" CONTENT=\"(.)*\">", $strAux,
$arrKeywords);
and the variable $arrKeywords[1] is : poli, easjkdha, owersweoihjwe, uitsodgfisdgisdiv">
<meta name="description" content="aaaaaaaaaaaaa, wwwwwwwwwwwwwwwwwwww,
wereeeeeeeeeee, rrrrrrrrrrrrr">
<title>osdfjsoidiid werioeiorigfs dfv sdfvo sdivvhdoososos </title>
</head>
<body>
siodfhyusiodfusdfjkdjfskodjfdjfsdkljfskldjfsd
sdfskdjfhksdjfhskldsldkjfsldkfjsldkfjsldkfjsdf
<a href="aaaaa.php
It gets all the string till the last "> . But i need to go till the first "> after
meta ....
Thanks
Mircea