RE: [PHP] RegEx (back referencing)
| From: | Phil Ewington | Date: | Sat, 03 Aug 2002 17:17:23 +0000 |
| Subject: | RE: [PHP] RegEx (back referencing) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110972@lists.php.net to get a copy of this message | ||
What's strange is that doing an ord($string) returns 171, which is a '1/2'
char. So why does PHP convert the pattern match??
> -----Original Message-----
> From: Phil Ewington [mailto:phil@n-igma.net]
> Sent: 03 August 2002 17:04
> To: PHP General
> Subject: [PHP] RegEx (back referencing)
>
>
> Hi,
>
> I am am writing a function to color code and indent JavaScript
> source using
> regular expressions and cannot seem to get back referencing working. The
> pattern match is successful but the output is a single unrecognised
> character (a square).
>
> $string = eregi_replace("<(/?)(scr[^>]*)>", "«font
> color=maroon»\1«/font»",
> $string);
>
> This results in opening and closing <script></script> tags being replaced
> with a square being wrapped in font tags. I have this working in
> Cold Fusion
> but cannot seem to convert my scripts to PHP. Can anyone help?
>
> TIA
>
> Phil Ewington.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>