I recommend reading the Emacs Lisp manual instead of Emacswiki.
Here's some of it on backslash sequences in regular expressions:
matches any character whose syntax is CODE. Here CODE is a
character that represents a syntax code: thus, ‘w’ for word
constituent, ‘-’ for whitespace, ‘(’ for open parenthesis, etc. To
No, regplace-regexp-in-string does not magically substitute the buffer string into the STRING argument. It is a function but not a command (does not have an interactive specification).
The command you are actually looking for is query-replace-regexp which can be used interactively and is bound to C-M-%.
Use: C-M-% [0-9] RET \,(string (+ (string-to-char \&...
? is the zero-or-one quantifier: \\(...\\)? says the group may or may not match anything.
Make it non-capturing if you don't care about backreferences to that group: \\(?:...\\)?
I tried this but it doesn't work, the \n literals prevent the following ^ from being detected.
^ only has its special meaning in certain positions; You can't put it anywhere ...
. matches any single character except a newline, so ^.*( matches from line beginning till (, thus all lines besides the empty line matches. Don't forget the first line contains (:
Exercise 2.32. ... For example, if the set is (1 2 3), ...
You should change . into \s- (it matches any whitespace character, you can also just use space character).
However, I ...
The character class name should be enclosed between [: and :](see emacs manual), the correct pattern is
Since you have a single group you can skip the parentheses and refer to the whole match with \&, e.g:
^[[:digit:]] → ** \&
The following elisp code defines a new minor mode web-hide-attr-mode.
It is hooked to web-mode. So it is already active if you open a document in web-mode.
You can toggle it by M-x web-hide-attr-mode.
It works by adding an entry to font-lock-keywords that puts the invisible property web-hide-attr on the html attributes and by adding web-hide-attr to the ...