Re: regular expressions question
| From: | Rasmus Lerdorf | Date: | Wed, 30 Oct 2002 15:25:55 +0000 |
| Subject: | Re: regular expressions question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122032@lists.php.net to get a copy of this message | ||
$str = "(this)example";
preg_match("/\((.*?)\)(.*)/",$str,$regs);
$a[0] = $regs[1];
$a[1] = $regs[1].$regs[2];
On Wed, 30 Oct 2002, Simon Dedeyne wrote:
> I have a little question. I'm having some difficulty with regular
> expressions:
>
> here it is:
> (this)example
> should be output in an array
> [0]=> this
> [1]=> thisexample
>
> I'm supposing this should be done with preg_grep, but I'm not really
> familiar with some of it's syntax for the regular expression.
> I could use some ideas,
>
>
> cheers,
> Simon
>
>