Re: ereg

From: Date: Fri, 12 Sep 2003 19:36:08 +0000
Subject: Re: ereg
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-162465@lists.php.net to get a copy of this message
I think this is a lot more complicated than somethign a simple regular expression can handle. You would need to do soemthign that reads the entire file, up until the first occurrence of your '//' and in the meantime do a count that checks to make sure all the quotes are closed. I'd be interested to see what you come up with... although I'm sure just borrowing some syntax highlighting code. -dd "Alexander Sundli" <alexander@keyteq.no> wrote in message news:20030912073227.66126.qmail@pb1.pair.com... > I use this expression to remove oneline comments: > iereg_replace("//([^\n]*)\n",'',$code); > > I need to make a check if this expression is inside a string. If it is, its > not a comment. > > I think it has something to do with context.. > > Anyone who could help me? > > thanx

« previous php.general (#162465) next »