Re: Help with regular expressions
| From: | Jeff Sheltren | Date: | Fri, 25 Jan 2002 01:09:07 +0000 |
| Subject: | Re: Help with regular expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-82028@lists.php.net to get a copy of this message | ||
I think your problem is you are not including whitespace. Also, remember
that . (dot) means any character except newline, so why not try this as your
reg ex:
//.*
Hope that helps.
-Jeff
----- Original Message -----
From: "José Daniel Ramos Wey" <wey@one2one.com.br>
To: <php-general@lists.php.net>
Sent: Thursday, January 24, 2002 5:00 PM
Subject: [PHP] Help with regular expressions
> Hi! I´m new to regular expressions, and it seems to be an art to make it
> work as expected.
>
> I´m trying to remove all "single-line" comments from an string - that´s
> everything after "//" to the end of a line. I expected that this would do
> the job: ereg_replace("//[[:alnum:]]*\n","",$string), but it didn´t work.
>
> Any tips?
>
> TIA,
> Daniel Wey
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>