Escape regular expressions

Safer handling of regular expression by escaping the parts from the user or the network.