> I am getting an error on the following line:
> 
> if(preg_match('s/l$//', $string))
> 
> The error is:
> 
> Warning:  Delimiter must not be alphanumeric or backslash in
> /u1/jab/devel/whitespace/whitespace.php on line 136.
> 
> I know that pcre in PHP is not exactly interchangeable.  Any ideas on
how
> to get this to work?  TIA.

Come on man... this is the first paragraph of the chapter on the
Perl-Compatible regular expressions:

"The syntax for patterns used in these functions closely resembles Perl.
The expression should be enclosed in the delimiters, a forward slash
(/), for example. Any character can be used for delimiter as long as
it's not alphanumeric or backslash (\). If the delimiter character has
to be used in the expression itself, it needs to be escaped by
backslash. Since PHP 4.0.4, you can also use Perl-style (), {}, [], and
<> matching delimiters."

Is it really that hard to figure out? There are examples on the page,
too.

http://www.php.net/manual/en/ref.pcre.php

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to