Re: why does this regex not work ??
| From: | Stas Trefilov | Date: | Mon, 24 Jul 2000 14:10:24 +0000 |
| Subject: | Re: why does this regex not work ?? | ||
| References: | 1 | Groups: | php.windows php.windows |
| Request: | Send a blank email to php-windows+get-1262@lists.php.net to get a copy of this message | ||
geoka wrote:
>
>
> i think i need an ungreedy ? cause somthing like
> this
> /* 111 */ $i++; /* 222*/
> would be recognized only as one comand cause the
> end of the line matches the expression, too.
> so, whats wrong
I don't think ereg* functions understand ungreediness. You may try preg*
functions or rewrite your own (maybe like this):
ereg ("/\*(([^*]/|[^/])*)\*/", $text, $results);
In $results[1] you will find your comment.
P.S. Sorry for a possible unreadability... This is my way, you may find
yours.
--
Stas Trefilov
Moscow Russia