[snip]
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).
[/snip]
Thanks Johnth
Jay Blanchard wrote:
[snip]
Anot 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
[snip]
Anot 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
e
Jay Blanchard wrote:
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs);
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( "/\((\d{1,}.*?)\)/", "U
[snip]
You won't match the dot btw:
\(([.0-9]*)\)
Which is crude since it will match more than one dot :)
[/snip]
Typo on my part \(([0-9\.]*)\)...but still gets parenthesis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, 2006-06-19 at 14:42, John Nichel wrote:
> Jay Blanchard wrote:
> > I have a field that contains a value in parenthesis', but also contains
> > other text, for instance; (it is a legacy app that I am working with,
> > and by legacy I am saying pre-1980)
> >
> > Upper voltage (124.1)
> >
>
Jay Blanchard wrote:
I have a field that contains a value in parenthesis', but also contains
other text, for instance; (it is a legacy app that I am working with,
and by legacy I am saying pre-1980)
Upper voltage (124.1)
I know that \([0-9]*\) will get me (124.1), but I am totally forgetting
ho
I have a field that contains a value in parenthesis', but also contains
other text, for instance; (it is a legacy app that I am working with,
and by legacy I am saying pre-1980)
Upper voltage (124.1)
I know that \([0-9]*\) will get me (124.1), but I am totally forgetting
how to get 124.1 without
9 matches
Mail list logo