On Thu, 2009-02-26 at 10:09 -0500, Alice Wei wrote:
> Hi,
>
> I have two lines here as follows:
>
> 1 -0.123701962557954E+03 0.460967618024691E+02
> -0.12354765900E+03 0.46259109000E+02
>
> What I am trying to do here is to only have
>
> 1 -0.123701962557954E+0
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I
can do further processin
Alice Wei wrote:
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-24 23:55:27 +0100:
>> Roman Neuhauser wrote:
>>> Are you doing this to learn regular expressions or are you actually
>>> trying to do work? Because you're going the wrong way.
>>> It's XML, why do you treat it as text?
>> not everyone shares th
Richard Luckhurst wrote:
> Hi Jochem,
>
> JM>
> JM> you be needing an ungreedy modifier on yer regex.
> JM>
>
> JM> see here:
> JM> http://php.net/manual/en/reference.pcre.pattern.modifiers.php
>
> Thanks very much. That solved my problem and I my now getting exactly what I
> want. I h
You want to add a 'U' after you closing # so that matches are
"Ungreedy" -- I.e., they do NOT grab as much text as the can to
fulfill the pattern (greedy) but they grab as LITTLE text as they can
to fulfill the pattern (ungreedy)
On Wed, January 24, 2007 4:27 pm, Richard Luckhurst wrote:
> Hi List
At 1/24/2007 02:27 PM, Richard Luckhurst wrote:
What I am trying to do is extract the first chunk.
...
preg_match('##', $xml_string,$matches);
$tempstr = $matches[0];
What I actually get in $tempstr is everything from the first through to
the last (second)
I would have expected preg_match
# [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100:
>
> addInfPrice="0.0">
>
>
>
>
>
> addInfPrice="0.0">
>
>
>
# [EMAIL PROTECTED] / 2007-01-24 23:55:27 +0100:
> Roman Neuhauser wrote:
> > Are you doing this to learn regular expressions or are you actually
> > trying to do work? Because you're going the wrong way.
> > It's XML, why do you treat it as text?
>
> not everyone shares that sentiment. in terms o
Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100:
>> I must be dumb as I have been battling my way through regular expression
>> examples for a while and I can not work out why the following does not work
>> properly. I am the first to admit that regular expressions confuse
# [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100:
> I must be dumb as I have been battling my way through regular expression
> examples for a while and I can not work out why the following does not work
> properly. I am the first to admit that regular expressions confuse me greatly.
>
> The string
- don't use /^ .. $/ if you want to replace all occurences. ^ and $ refer
to the very start and end of the whole string
and make no sense at all - at least in this case. your regexp will not
match at all unless $var contains only a
single variable and nothing more
- either capture (somethin
On Wednesday 03 July 2002 01:59, Martin Clifford wrote:
> Even this:
>
> $output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "\\1", $var);
> echo $output;
>
> Doesn't work. It just takes whatever you put into $var, then puts it into
> $output, and outputs it to the screen.
>
> I want to change
On Tuesday, July 2, 2002, at 01:40 PM, Martin Clifford wrote:
> I'm trying to get this darn eregi_replace() to work, but it doesn't
> produce any results at all.
>
> I want it to find all occurances of PHP variables. Here is the regexp
>
> $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$",
Even this:
$output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "\\1", $var);
echo $output;
Doesn't work. It just takes whatever you put into $var, then puts it into $output,
and outputs it to the screen.
I want to change anything resembling a PHP variable, i.e. $var, $$var or &$var to
$var
On Wednesday 03 July 2002 01:40, Martin Clifford wrote:
> Hey all!
>
> I'm trying to get this darn eregi_replace() to work, but it doesn't produce
> any results at all.
>
> I want it to find all occurances of PHP variables. Here is the regexp
>
> $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$
> While I try and request for a recompile of the system, is there an
> alternate way out?
Why don't you use the PCRE functions instead.
The equivalent preg would be:
preg_match("/__([a-z0-9_]+)__/i", "Hello __WO_RD__ Test", $Matches)
> By the way, what is the significance of the switch --wit
Regards,
Sharat
>From: Rasmus Lerdorf <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED], <[EMAIL PROTECTED]>
>Subject: Re: [PHP] Regular Expression Problem continues
>Date: Thu, 28 Mar 2002 11:40:41 -0800 (PST)
>
>In your config
gt;From: Miguel Cruz <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression Problem continues
> >Date: Thu, 28 Mar 2002 12:51:44 -0600 (CST)
> >
> >Works for me in 4.1.1 (and 4.1.
.byronholidays.com/inikatest/testereg.php
To check the PHP version on the server, you can run
http://www.byronholidays.com/inikatest/checkenv.php3
Regards,
Sharat
>From: Miguel Cruz <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re:
Rasmus Lerdorf <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression Problem continues
> >Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST)
> >
> >This code works fine:
>
not work with PHP Version 4.1.1. That is where I have a problem.
>
> With Regards,
> Sharat
>
> >From: Rasmus Lerdorf <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression P
Rasmus,
The code worked fine in PHP Version 3.x
It does not work with PHP Version 4.1.1. That is where I have a problem.
With Regards,
Sharat
>From: Rasmus Lerdorf <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] Re
This code works fine:
eregi("__([a-z0-9_]+)__", "Hello __WO_RD__ Test", $Matches);
echo $Matches[1];
produces:
WO_RD
-Rasmus
On Thu, 28 Mar 2002, Sharat Hegde wrote:
> Hello,
>
> I am still having problems with the regular expressions. Looks like there
> has been a change in the way they are
__([a-z0-9][a-z0-9_]+)__
-Original Message-
From: Sharat Hegde [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 4:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Regular Expression Problem
Hello,
In PHP3, I am using code which using the regular expression capability of
PHP. The code
Andrey,
Thanks for the time that you put into this!
After some tweaking (for my scripts) I got this working nicely, and learned
a thing or two about PREG also.
Ross Nielsen
[EMAIL PROTECTED]
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
02d801c12f2e$c1a60a90$0b01a8c0@ANDreY">news:02d801
Some time spent to try but now i think it works:
";
$a='datadatadatadata[link1]datadatadata{link2}data[link3]';
// $a='datadata{link1}data[link2]datadatadata{link3}data[link4]';
$pattern='/((\[)|\{)(.+?)(?(2)\]|\})/';
echo $a."\n";
echo $pattern."\n";
preg_match_all($pattern,$a,$matches,PREG
27 matches
Mail list logo