What does regex [* \ f] + mean?

In org mode, the outline-regexp variable is set to "[*\f]+" .

I can’t understand what he means, referred to it without success.

Edit: - [* \ f] + changed to "[*\f]+"

+4
source share
3 answers

The default value corresponds to asterisks and page breaks: "[* \ E] +"

http://www.emacswiki.org/emacs/OutlineMode#toc2

+5
source

\f stands for the form feed, which is a special character used to tell the printer to start a new page.

[*\f]+ Then it means any sequence that consists entirely of * and the feed form is arbitrarily long.

+5
source

Ch i g (elisp) Regexp Special RET

 Note also that the usual regexp special characters are not special inside a character alternative. A completely different set of characters is special inside character alternatives: `]', `-' and `^'. 

Thus, [*\f]+ matches any sequence of at least one character length and contains (only) any number and combination of asterisks, backslashes, and the letter "f".

EDIT:

Ah, you really meant "[*\f]" , didn't you? This is not the same as regexp [*\f] (since the latter will be represented in the line-reading syntax as "[*\\f]" ).

Make sure you specify the correct one.

If you were referring to "[*\f]" , then \f really a feed-feed, as evidenced by other answers.

+2
source

Source: https://habr.com/ru/post/1486838/


All Articles