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
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 proces
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
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
RL Thanks very much. That solved my problem and I my now getting exactly what I
RL want. I had seen the reference to greedy and ungre
# [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
Hi Roman,
RN> Are you doing this to learn regular expressions or are you actually
RN> trying to do work? Because you're going the wrong way.
RN> It's XML, why do you treat it as text?
I am well aware it is XML and I could use an XML parser or simpleXML. I am
trying to learn regular expressions as
# [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
Hi List
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 piece of XML as follows and I have put that s
Hi Guy and Gay ?
I have the following code supposed to transform date format like this 04 desambra 1975
into 1975-12-04.
User can use whatever language he want like french, english, malagasy even Bichlamar-
for example : 04, otis 1975 = 04 aout 1975 = 04 aogositra 1975 = 04-août 1975 = 04
august
I just moved some *working* code from a Win2k server running PHP 4.2.1
to a FreeBSD server running 4.2.3 and the following code no longer
works...
$templatetext = preg_replace("//e", "g_includecallback(\"\\1\")", $templatetext);
if (!preg_match("/([[:ascii:]]+?)([[:ascii:]]+?)([[:ascii:
- 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]+$
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]+$", "\\1", $var);
As you might guess this is for a syntax highlighti
> 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
Hello,
I am still having problems with the regular expressions. Looks like there
has been a change in the way they are handled between PHP3 and PHP4, since
the code worked with PHP3 !!
I need to search for all words having alphanumberic characters as well as _
(underscore) which are prefixed
__([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
Hello,
In PHP3, I am using code which using the regular expression capability of
PHP. The code matches all occurences of string prefixed by __ (2
underscores) and having alphanumeric characters as well as _ (1 underscore)
within it.
The code is as follows:
while (eregi("__([a-z0-9_]+)__", $E
Hi,
Could someone be kind enough to have a look at this regular expression
and perhaps tell me why is returns false when a '-' character is
included in the $center string?
if (eregi("^[a-zA-Z0-9!@#\$%^&\*\(\),/.//<>\?;':\"~`_\+\|\-\\\t\n\
]*$", $center))
{
return true;
}
else
{
ring.
> Explanation : Looking for more than one using preg_match_all. Matching for
[ or {, [ is in () because at the end we test if we found
> [ so we look for ] otherwise { is found so we look for matching }. (?(1)
true|false) is 1 as a backreference is set so we found [.
>
> Hope this wi
ill help you.
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%
- Original Message -
From: "Ross Nielsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 9:42 PM
Subject: [PHP] Regular Expression Problem and PHP 4 (urgent)
Well my first solution didn't really work the way I needed it too so here
goes again...
Data returned from server process looks like following...
Header
datadatadatadata[link]datadatadata{link}data[link]
datadata{link}data[link]datadatadata{link}data[link]
datadatadatadata[link]datadatadata{link
Here is the problem:
I'm retrieving a page of data from another process using PHP4 on Solaris
2.51
This data is placed in an array by line and simply returned to the browser
after formatting.
A sample line may look something like this:
blah blah blah blah blah blah blah blah blah
I think I ne
39 matches
Mail list logo