<?php $str = "xxx - 12, ABC DEF GHI"; $pattern = "/([A-Z]+ - [0-9]+,) ([A-Z\s]+)/i"; $replace = "$1 ($2)"; echo preg_replace($pattern,$replace,$str);
You have javascript disabled. You will not be able to edit any code.