ssage-
From: Randall Perry [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 4:07 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Unable to match dollar sign in preg_match
Hokay, that works, but what's with the triple backslashes?
preg_match ("/^.*_\%split\%_$(\d*\.\d*)/",
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: 24 December 2002 00:44
>
> I don't know. I just got that from reading the manual. The very first
> user comment on the preg_match page.
Sorry, misread this before and took the explanation below as John replying
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: 24 December 2002 00:44
>
> If you want to use some of PHP's special characters in your
> expression,
Don't you mean "preg's special characters"? Or even "PHP special characters which are
also preg special ch
es...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
> -Original Message-
> From: Randall Perry [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 23, 2002 4:07 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Unable to
Hokay, that works, but what's with the triple backslashes?
>> preg_match ("/^.*_\%split\%_$(\d*\.\d*)/", $data, $match);
>
> Should be
>
> preg_match ("/^.*_\%split\%_\\\$(\d*\.\d*)/", $data, $match);
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get y
> preg_match ("/^.*_\%split\%_$(\d*\.\d*)/", $data, $match);
Should be
preg_match ("/^.*_\%split\%_\\\$(\d*\.\d*)/", $data, $match);
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--
PHP General Mailing List (http:
Here's my expression:
$data = "xyz_%split%_$10.21";
preg_match ("/^.*_\%split\%_$(\d*\.\d*)/", $data, $match);
Returns nothing (escaping the $ with a \ does the same), but this returns
10.21:
preg_match ("/^.*_\%split\%_\D*(\d*\.\d*)/", $data, $match);
How is it done?
--
Randall Perry
sysTame
7 matches
Mail list logo