-Original Message-
From: MikeP [mailto:mpel...@princeton.edu]
Sent: Thursday, December 18, 2008 8:43 AM
To: php-general@lists.php.net
Subject: [PHP] Regex Problem
Hello,
I have a quirky behavior I'm trying to resolve.
I have a REGEX that will find a function definition in a php
Boyd, Todd M. tmbo...@ccis.edu wrote in message
news:33bde0b2c17eef46acbe00537cf2a190037b7...@exchcluster.ccis.edu...
-Original Message-
From: MikeP [mailto:mpel...@princeton.edu]
Sent: Thursday, December 18, 2008 8:43 AM
To: php-general@lists.php.net
Subject: [PHP] Regex Problem
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me
Dave Goodchild schrieb:
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm
[snip]
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a hint why the regex also is true for
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a
Robin Vickery schrieb:
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm
Merlin wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a hint why the regex also is
On Thu, June 1, 2006 4:56 am, Merlin wrote:
^(.*)_a[0-9](.*).htm$
Don't know what it will help, but you need \\.htm in PHP to get \.htm
in PCRE to escape the . in the extension.
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close [EMAIL PROTECTED] wrote:
I'm trying to get a simple regex to work. Here is the test script I have.
#!/usr/bin/php -q
?
$string = hello\nworld\n;
$string = preg_replace(/[^\r]\n/i,\r\n,$string);
$string =
Why is it taking the char before the [^\r] also?
-Josh
On Thu, 1 Jul 2004 15:17:04 -0700, Justin Patrin [EMAIL PROTECTED] wrote:
On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close [EMAIL PROTECTED] wrote:
I'm trying to get a simple regex to work. Here is the test script I have.
* Thus wrote Justin Patrin:
On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close [EMAIL PROTECTED] wrote:
I'm trying to get a simple regex to work. Here is the test script I have.
#!/usr/bin/php -q
?
$string = hello\nworld\n;
$string = preg_replace(/[^\r]\n/i,\r\n,$string);
$string
On 15 August 2003 12:02, Merlin wrote:
Hi there,
I have a regex problem.
Basicly I do not want to match:
/dir/test/contact.html
But I do want to match:
/test/contact.html
I tryed this one:
^[!dir]/(.*)/contact(.*).html$
Well, that's not going to work because the construct
Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, :
Is this what you are trying to match. if so, try this.
if ( preg_match(/[^0-9\#\:\.\-]/, $_POST['nums1']) ) {
throw error()
}
This will match anything that is not a number or one of the other special
chars that are in
: Saturday, May 31, 2003 6:04 PM
Subject: Re: [PHP] regex problem
Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, :
Is this what you are trying to match. if so, try this.
if ( preg_match(/[^0-9\#\:\.\-]/, $_POST['nums1']) ) {
throw error()
}
This will match
suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);
I would like to get an output of all possible combinations of the
sentence
with the words between brackets:
eg.
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot
suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);
I would like to get an output of all possible combinations of the sentence
with the words between brackets:
eg.
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot
My solution:
ereg(^[:space:]*\*,$variable)
Try
ereg(^[:space:]\**$,$variable)
or
ereg(^[ ]*\**$,$variable)
or
ereg(^[[:space:]]*\**$,$variable)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To
18 matches
Mail list logo