I mean something like https://rubular.com/ where I can enter text and experiment with regular expressions to match that text.
-
I have found regex-tool on melpa and will try it. – ruby_object May 19 '22 at 13:06
-
2You can also try `M-x re-builder`. It is shipped with Emacs. – Tobias May 19 '22 at 13:11
-
1I have seen it. But is there documentation that explains how to use it? – ruby_object May 19 '22 at 13:13
-
https://www.masteringemacs.org/article/re-builder-interactive-regexp-builder Note, you can also switch the syntax via the Re-builder menu. – Tobias May 19 '22 at 13:14
-
Do you understand it? Can you answer additional questions? In regex-tool I can have instant visual feedback when I try regular expressions and everything is self-explanatory. I do not understand re-builder commands and do not understand what to expect. Do you know of any readable example? – ruby_object May 19 '22 at 13:16
-
I don't have much time. But we can try in the following chat: https://chat.stackexchange.com/rooms/136428/re-builder – Tobias May 19 '22 at 13:24
-
It turns out that my confusion with re-builder was caused by some oddities of trying it in the scratch buffer. – ruby_object May 19 '22 at 13:39
1 Answers
The documentation for re-builder
is a bit sparse. You can see the basics via C-h f re-builder
:
This command makes the current buffer the "target" buffer of the regexp builder. It displays a buffer named "RE-Builder" in another window, initially containing an empty regexp.
As you edit the regexp in the "RE-Builder" buffer, the matching parts of the target buffer will be highlighted.
To use it, you open a file with the text you want to test your regexps with. Then you call M-x re-builder
. A new window will be created at the bottom of the screen, with the empty regexp ""
in it. As you add text to the regexp, matches in the target buffer are highlighted, and match groups are given different colours:
More details are found at the article @Tobias linked from Mastering Emacs

- 21,719
- 1
- 52
- 92