I'm composing a complex regular expression and the user can supply a part of the expression. However, the user-supplied part should be interpreted literally, i.e. regexp special characters should be escaped. Is there a function for escaping these characters? It seems like a common thing to do but all my googling was unsuccessful.
(re-search-forward (format "\b%s\b" user-string))
test*case, I want to match
test*case but not