On Wed, September 20, 2006 11:20 am, Pawel Miroslawski wrote:
> Hi
> it's example script:
>
> $string = "This is some _color:pink_ colored text _color_";
>
> $patterns[0] = '/_color:(.*?)_/';
> $patterns[1] = '/_color_/';
> $replacements[0] = '';
> $replacements[1] = '';
>
> echo preg_replace($pat
Hi
it's example script:
';
$replacements[1] = '';
echo preg_replace($patterns, $replacements, $string);
?>
It should be ok, but i don't test it.
Pawel
MAIL PROTECTED]
> Sent: Wednesday, September 20, 2006 2:13 PM
> To: Peter Lauri
> Cc: 'PHP General'
> Subject: RE: [PHP] preg_replace (again) [solved]
>
> On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
>> Just to share my solution:
>
> Out of cur
private system, so I do not worry so much :)
/Peter
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 2:13 PM
To: Peter Lauri
Cc: 'PHP General'
Subject: RE: [PHP] preg_replace (again) [solved]
On Wed, 2006-09-20 at 11:45 +0
On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote:
> Just to share my solution:
Out of curiosity, why don't you go with the very well known BBCode
system?
> preg_replace('/_color:(.*?)_(.*?)_color_/i', '$2',
> $html);
Hopefully this is a private system, otherwise someone not very nice
might d
Just to share my solution:
preg_replace('/_color:(.*?)_(.*?)_color_/i', '$2',
$html);
/Peter
-Original Message-
From: Peter Lauri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 9:42 AM
To: 'PHP General'
Subject: [PHP] preg_replace (again
Hi group,
I know I am a little bit stupid when it comes to actually figuring out how
to use the preg_match and preg_replace. This is what I am facing:
A string like this: This is some _color:pink_ colored text _color_ that I
want to transfer
Should convert to: This is some colored text
7 matches
Mail list logo