Re: regex brain-toot

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

 



Jay Blanchard wrote:
[snip]
Ahhhh....not PCRE. Can't help you there, as I've never used the ereg functions. However...

preg_match ( "/\((\d{1,}.*?)\)/", "Upper Voltage (124.1)", $regs );
[/snip]

Still returns parentheses

ereg("[^\(][0-9\.]*" , "Upper Voltage (124.1)", $regs );

gets rid of opening bracket, but

ereg("[^\(][0-9\.]*[^\)]" , "Upper Voltage (124.1)", $regs );

doesn't


Do you have to use ereg? The preg_match pattern I posted works fine. It will return an array, first element being the whole string it matched, next element will be what it matched _inside_ the parentheses (less the parentheses) (if it matches anything that is).

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel@xxxxxxxxxxxxxxxxxxxxxxxxxxx

--
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