Format regex with string substitutions. Auto-escape RegExp special characters