<?php var_dump(mb_ereg_replace('\s*(?<word>\w+)\s*', "_\k<word>_\k'word'_", ' foo '));
You have javascript disabled. You will not be able to edit any code.