Re: HELP , HELP ,HELP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, March 29, 2005 4:49 pm, wangchq said:
>  if(eregi("^\$[0-9]+\,[0-9]+\.[0-9]+",$set,$account)){

For starters:

PHP use \ as an escape character for $ inside of ""
Regex uses \ as an escape character for $ as a literal rather than
line-end character.

So your \$ should be \\\$, because PHP will "eat" the \\ and turn that
into \ and then PHP will "eat" the \$ and turn that into $, and then
you'll be passing \$ to Regex.

As it stands now, your Regular expression is:
^$[0-9+...
which is basically an invalid expression, as it has a bunch of crap
trailing after the new-line ($) symbol.

Disclaimer:  I'm *NOT* good at Regex.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux