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
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
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+03
# [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 is a
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 me
# [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 of lowest
# [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100:
flights
flight flightId=19417361 addAdtPrice=0.0 addChdPrice=0.0
addInfPrice=0.0
legXRefs
legXRef legId=23862812 class=V/legXRef
legXRef legId=23862813
At 1/24/2007 02:27 PM, Richard Luckhurst wrote:
What I am trying to do is extract the first flight . /flight chunk.
...
preg_match('#flight .*\/flight#', $xml_string,$matches);
$tempstr = $matches[0];
What I actually get in $tempstr is everything from the first flight
through to
the
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
Richard Luckhurst wrote:
Hi Jochem,
JM accent voice=pirate
JM you be needing an ungreedy modifier on yer regex.
JM /accent
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
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 that sentiment.
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]+$,
Even this:
$output = preg_replace(/^[\$]{1,2}[a-zA-Z][0-9]+$/, b\\1/b, $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
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]+$, b\\1/b,
On Wednesday 03 July 2002 01:59, Martin Clifford wrote:
Even this:
$output = preg_replace(/^[\$]{1,2}[a-zA-Z][0-9]+$/, b\\1/b, $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
- 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
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
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] Regular Expression Problem continues
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 Problem continues
Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST)
This code works fine
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:
eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches);
echo $Matches[1];
produces:
WO_RD
-Rasmus
On Thu, 28
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.2) too. Are you sure there's not something
else going on? Can you provide an unadulterated code sample
://www.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: [PHP] Regular Expression
.
With 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 configure flags you have: --with-regex=system
Why did you do
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
__([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
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
Some time spent to try but now i think it works:
?php
echo pre;
$a='datadatadatadata[link1]datadatadata{link2}data[link3]';
// $a='datadata{link1}data[link2]datadatadata{link3}data[link4]';
$pattern='/((\[)|\{)(.+?)(?(2)\]|\})/';
echo $a.\n;
echo $pattern.\n;
27 matches
Mail list logo