In emacs lisp I only know the functions string-match[-p], but I know no method for matching a literal string to a string.
E.g. assume that I have a string generated by some function and want to know if another string contains it. In many cases string-match-p will work fine, but when the generated string contains regexp syntax, it will result in unexpected behaviour, maybe even crash if the regular expression syntax contained is invalid (e.g. unbalanced quoted parentheses \(, \)).
- Is the some function in emacs lisp, that is similiar to
string-match-pbut doesn't interpret regular expression syntax? - As regexp-matching is implemented in C I assume that matching the correct regexp is faster than some
substring/string=loop; Is there some method to escape an arbitrary string into a regular expression that matches that string and only that string?