I need a regex to replace '''string'''
with <b>string</b>
this one wont work: '/'''(.*?)'''/'
I need a regex to replace '''string'''
with <b>string</b>
this one wont work: '/'''(.*?)'''/'
Make sure to escape the single quotes with backslashes:
'/\'\'\'(.*?)\'\'\'/'
Or just use double quotes in which case you don't have to worry about escaping single quotes:
"/'''(.*?)'''/"
$string = "guns '''hurt''' people";
echo preg_replace ("/'''(.*)'''/", '<b>$1</b>', $string);