escaping

In regular expressions, escaping refers to canceling the special function of certain characters. It is typically necessary when searching for punctuation.

For example, a dot (or full stop) ‘.’ in a regular expression is used to find any character. To find the actual dot or full stop, the dot has to be escaped to cancel its special function. A backslash is used to escape a dot.

∖.

In CQL, because regular expressions are part of CQL, to find the word however with commas before and after, this CQL should be used. The commas must be escaped.

[word="∖,"] [word="however"] [word="∖,"]

All of these characters need to be excaped if you want to search for the character:
. ^ $ * + ? ( ) [ ] { } | \
So to find a dot, the dot has to be escaped with a backslash: \.To find a backslash, the backslash has to be escaped with a backslash \\

 

See also

Regular Expressions in corpus analysis

CQL – Corpus Query Language for corpus analysis

« Back to Glossary Index