Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Analysis & Solutions
On Fri, Jul 12, 2002 at 12:08:36AM -0400, Monty wrote: > expressions. Can you tell me what the open and closing slashes / are for > inside the quotes? Is it equivalent to [ and ] for ereg? They are "delimiters." Other characters can be used, but / is the standard. --Dan -- PHP

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Monty
Yes! That was it! Thank you so much. I actually thought preg and ereg were interchangeable, so, I'm glad you pointed out the difference for reg expressions. Can you tell me what the open and closing slashes / are for inside the quotes? Is it equivalent to [ and ] for ereg? Monty > DOH! It's pre

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Analysis & Solutions
On Thu, Jul 11, 2002 at 11:24:34PM -0400, Monty wrote: > $contentpage = preg_split("[[:space:]]*page_break[[:space:]]*", $content); DOH! It's preg!!! [[:space:]] is for ereg. Use \s. I don't know why I didn't notice sooner. Do this: '/\s*page_break\s*/' --Dan -- PHP cl

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Monty
> Have you tried [[:space:]]* instead? That'll pull in line breaks, tabs > and spaces. > > --Dan I just tried it, but, still can't make this work. Also, I'm getting different results between explode() and preg_split(), is that normal? Here's what I'm trying: $content = "blah blah page_brea

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Analysis & Solutions
On Thu, Jul 11, 2002 at 07:33:59PM -0400, Monty wrote: > > Thanks Dan. But, removing the asterisk or putting it after the character > class doesn't work either for some reason. Have you tried [[:space:]]* instead? That'll pull in line breaks, tabs and spaces. --Dan -- PHP cl

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Monty
> The * needs to be after the character class, ie [[:cntrl:]]*. > > --Dan Thanks Dan. But, removing the asterisk or putting it after the character class doesn't work either for some reason. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Analysis & Solutions
On Thu, Jul 11, 2002 at 06:41:28PM -0400, Monty wrote: > I'm trying to preg_split() text between "". I used the following but > can't get the regular expression to work: > > $content = "blah blah blah blah blah"; > $paged = preg_split( "[[:cntrl:]*][[:cntrl:]*]", $content ); The * needs to be a

[PHP] RegExp Help: [:cntrl:] not working

2002-07-11 Thread Monty
I'm trying to preg_split() text between "". I used the following but can't get the regular expression to work: $content = "blah blah blah blah blah"; $paged = preg_split( "[[:cntrl:]*][[:cntrl:]*]", $content ); I also tried the following... $content = "blah blah blah blah blah"; $paged = preg