关于preg_match的基本内容

So, I want to change @ sign from this preg match:

[A-Z0-9._%+-]+@[A-Z0-9.-]{3,65}\.[A-Z]{2,4}

to (at) string, how make this work ;/ cant figure out.

You need to create groups and in your replacement, refer to these (backreferences).

search:  ([A-Z0-9._%+-]+)@([A-Z0-9.-]{3,65}.[A-Z]{2,4})
         `-- group #1 --´ `-------- group #2 ---------´

replace: \1(at)\2

I believe you are looking for

ideone Demo

$your_string = str_replace('@', '(at)', $your_string);

or

if(preg_match("/[A-Z0-9._%+-]+(@|\(at\))[A-Z0-9.-]{3,65}\.[A-Z]{2,4}/i", $your_string)){}