in reply to Convert a string in his pattern equivalence
Thanks, that was the function: "quotemeta".
And in a example,
$old = "(hola[amigo])"; $new = quotemeta($old); print "$old turns to $new"; [download]
Prints,