<?php $text = '[a][b] [[abc][a][b]]'; echo preg_replace('~(\[\[(?:(?!\[\[|]]).|(?1))*]])(*SKIP)(*F)|\[([^][]*)]~s', '<$2>', $text);
You have javascript disabled. You will not be able to edit any code.