RE: [PHP] Regex Problem

2008-12-18 Thread Boyd, Todd M.
-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

Re: [PHP] Regex Problem

2008-12-18 Thread MikeP
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

Re: [PHP] regex problem

2006-06-01 Thread Dave Goodchild
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

Re: [PHP] regex problem

2006-06-01 Thread Merlin
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

RE: [PHP] regex problem

2006-06-01 Thread Dan Parry
[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

Re: [PHP] regex problem

2006-06-01 Thread Robin Vickery
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

Re: [PHP] regex problem

2006-06-01 Thread Merlin
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

Re: [PHP] regex problem

2006-06-01 Thread John Nichel
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

Re: [PHP] regex problem

2006-06-01 Thread Richard Lynch
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,

Re: [PHP] regex problem

2004-07-01 Thread 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 =

Re: [PHP] regex problem

2004-07-01 Thread Josh Close
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.

Re: [PHP] regex problem

2004-07-01 Thread Curt Zirzow
* 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

RE: [PHP] regex problem

2003-08-15 Thread Ford, Mike [LSS]
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

Re: [PHP] regex problem

2003-06-01 Thread Jim Lucas
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

Re: [PHP] regex problem

2003-06-01 Thread Daniel J. Rychlik
: 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

RE: [PHP] regex problem

2003-03-16 Thread John W. Holmes
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

Re: [PHP] regex problem

2003-03-13 Thread CPT John W. Holmes
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

Re: [PHP] Regex problem

2001-10-25 Thread Kodrik
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