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

From: Date: Fri, 12 Jul 2002 03:24:34 +0000
Subject: Re: RegExp Help: [:cntrl:] not working
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-107307@lists.php.net to get a copy of this message
> 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_break blah blah blah blah"; $contentpage = preg_split("[[:space:]]*page_break[[:space:]]*", $content); But I just get a PHP error: Warning: Unknown modifier '*' in testme.php If I try this: $content = "blah blah page_break blah blah blah blah"; $contentpage = preg_split("[[:space:]]page_break[[:space:]]", $content); I get this PHP error: Warning: Unknown modifier 'p' in testme.php I'm not sure what I'm doing wrong with the reg exp, but, it won't even parse. Both expressions above used with explode() only produce empty array variables, as though it's stripping out everything. What am I doing wrong? Monty

« previous php.general (#107307) next »