<?php $string = 'start ** not bold ** and **bold** not bold **bold *** still bold** not bold **** not bold ****'; echo preg_replace('/(?<!\*)\*\*(?![\s*])(.*?)(?<![\s*])\*\*(?!\*)/', '<b>$1</b>', $string);
You have javascript disabled. You will not be able to edit any code.