Regular expression

Hello!

I am learning how to use regular expressions, I followed some tutorials and my regex works up to some point and would like some help on it, basically if I have a text in the form of

this is the sample text: {|plugin|fbcomm|fr_FR|350|} and bellow is the regex
$regex = “{\|plugin\|\w{6}\|[a-z]{2}_[A-Z]{2}\|\d{3}\|}”;

PHP does find and replace everything except the {}, I tried excaping those with a slash but then I get an error: Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in

the function I am using is this $text = preg_replace( $regex, “”, $text);

any help is appreciated

try the following code:

<?php

$str = "{|plugin|fbcomm|fr_FR|350|}";

echo "\
Input: ";
var_dump($str);

echo "\
Replacing text...";
$str = preg_replace("#^\\{\\|plugin\\|[a-z]+\\|[a-z_]{5}\\|\\d+\\|\\}$#i", "", $str);

echo "\
Output: ";
var_dump($str);

exit;

?>

The output of the script is:

Input: string(27) “{|plugin|fbcomm|fr_FR|350|}”
Replacing text…
Output: string(0) “”

thank you, that does work however I still needed to modify it because of my needs, at the end this is how I made it
/\{\|plugin\|\w{6}\|\w{2}_\w{2}\|\d{3}\|\}/