<?php $string = 'AreplacehereZ@domain.tld'; $pattern = '/[^A-Z](?=[^@]*@)/'; $replacement = '*'; $replace = preg_replace($pattern, $replacement, $string); echo $replace;
You have javascript disabled. You will not be able to edit any code.