Replace search pattern by regular expression