Escape regex special chars Code directly taken from Hmisc::escapeRegex

escape_regex(s)

Arguments

s

string to escape regex special chars from