<?php echo preg_replace('/#([0-9]*?([a-z]+[0-9]*)+)/i', '<a href="#">#$1</a>', '#11 #f1 #1f #ff');
You have javascript disabled. You will not be able to edit any code.