' (quote) or \ (backslash) -- Which is the escape character?
Posted: Mon Aug 11, 2003 2:22 pm
When writing up expressions, I used something like:
\.html
which should match on ".html" (so the period character is treated as a period instead of a special character used to mean "1 of any character at this position"). I think this is what the author told me to use.
However, according to http://www.newsbin.com/nb33help/regexp.htm, the quote character is the escape character, so my expression would be:
'.html
That just doesn't look right. Are both the quote and backslash used to denote "next character is a non-special character". Or is the backslash supposed to mean this and the quote actually does something else? Or is one deprecated and the other is the recommended mechanism?
\.html
which should match on ".html" (so the period character is treated as a period instead of a special character used to mean "1 of any character at this position"). I think this is what the author told me to use.
However, according to http://www.newsbin.com/nb33help/regexp.htm, the quote character is the escape character, so my expression would be:
'.html
That just doesn't look right. Are both the quote and backslash used to denote "next character is a non-special character". Or is the backslash supposed to mean this and the quote actually does something else? Or is one deprecated and the other is the recommended mechanism?