[ create a new paste ] login | about

Link: http://codepad.org/tleQqNhe    [ raw code | output | fork ]

PHP, pasted on Jun 23:
1
2
3
4
5
6
7
8
9
<?

$string = '//[langStart-en] This is a test //[langEnd-en]'; 
$pattern = '/\/\/\[langStart-en\][^n]*\/\/\[langEnd-en\]/'; 
$replacement = '//[langStart-en]//[langEnd-en]'; 
$my_string = preg_replace($pattern, $replacement, $string); 
echo $my_string;

?>


Output:
1
//[langStart-en]//[langEnd-en]


Create a new paste based on this one


Comments: