Sublime Forum

What is the meaning of sublime.LITERAL?

#1

view.find_all supports the optional flag LITERAL. What does LITERAL mean?

matches = self.view.find_all('the',
	sublime.LITERAL
)

I thought LITERAL is the same as whole word search to literally find all matches for the, but it also finds a match for thee.

0 Likes

#2

I think LITERAL disables regular expression.

For example, to find a match for the string 5 * 5:

matches = self.view.find_all('5 * 5',
	sublime.LITERAL
)

is equivalent to:

matches = self.view.find_all('5 \\* 5',
)
0 Likes