Re: [PHP] Regex Problem

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

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 i

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, vi

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

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 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

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 fo

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.h

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 giv

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"

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 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 = preg_replace("/([^\r])\n

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 con

Re: [PHP] regex problem

2003-06-01 Thread Daniel J. Rychlik
D]>; <[EMAIL PROTECTED]> Sent: 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\#\:\.\

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-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

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

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 PROTECT