Linked Questions

0 votes
0 answers
28 views

Matches from re-builder different from re-search-forward and search-forward-regexp due to double backslash [duplicate]

Following Org mode refiling gobbles a newline and absorbs the next heading where Org mode refiling has gobbled some of the next heading, I want to search for those gobbled headings where the stars are ...
miguelmorin's user avatar
  • 1,803
5 votes
2 answers
24k views

Escaping brackets in regexp

I tried these two, but none of them worked. (if (looking-at "\[") (insert "f")) (if (looking-at "[") (insert "f")) How can I escape square brackets in emacs regexp?
stacko's user avatar
  • 1,587
5 votes
2 answers
1k views

How can I add a compilation error regex for node js?

I can't seem to get emacs to recognize node stacktraces. As you can see, I've added what I think is a valid regular expression to compilation-error-regex-alist and compilation-error-regex-alist-alist, ...
Charles Lowell's user avatar
2 votes
1 answer
731 views

Replacing a string with symbols using font-lock?

I'm trying to make a font lock hook to replace strings of text for a mathmatical notation plugin. So I'm thinking " / " (note the spaces) will turn into " ÷ ", but "/" won't. (It's a package mainly ...
Chris's user avatar
  • 23
2 votes
1 answer
574 views

calling search-forward function with ^ and $ in the regexp pattern

I want to create a table in org-mode and use it in Ditaa The following function is created to replace “^+-” to “|-” and similarly, “^-+\s-*” to “-|”. Surprisingly, this does not work. (defun ditaa-...
Shankar Ramakrishnan's user avatar
1 vote
1 answer
495 views

re-search-forward Regex behavior for OR boolean

We usually use \| to depict OR in Regex. Using a\|b as input to Regexp I-search and Occur both gave the desired result. But re-search-forward seems unable to recognize this notation. abcdcba (re-...
Sati's user avatar
  • 775
2 votes
1 answer
629 views

Tramp Unable to Recognize Remote Prompt

I have been trying to get tramp working and I am having issues with recognizing the remote prompt. Unfortunately, I cannot change the remote prompt because it is dictated by my school. I have tried ...
Matt Daly's user avatar
1 vote
1 answer
380 views

Does Emacs have some kind of interactive regular expression editor?

I mean something like https://rubular.com/ where I can enter text and experiment with regular expressions to match that text.
ruby_object's user avatar
1 vote
2 answers
513 views

compilation-mode and next-error confusion

I'm going crazy trying to understand why compilation mode and next-error recognize some errors and not others. It appears as though we're long past the days of simple regexps for recognizing errors ...
kpixley's user avatar
  • 11
1 vote
1 answer
374 views

How to paste a multiline regex from re-builder into `replace-regexp`

I built with M-x re-builder a regex to match empty quoted lines in emails. In read syntax it is: "^>\\s-*\n>" How can I copy this regex in re-builder, so that I can paste it in the first ...
halloleo's user avatar
  • 1,311
0 votes
1 answer
174 views

How to re-search-forward OR

How can I match the values for the keys (org mode attributes) #+label OR #+name? Example: Using get-labels () I got fig:foo. Nice. How can I get fig:bar as well? #+label: fig:foo #+name: fig:bar ...
jjk's user avatar
  • 721
0 votes
1 answer
239 views

How to match a single ')' with replace-regex?

I want to replace a list in the form of 1) 2) 3) 4) with * * * I've tried using the regex [0-9]*\), but it gives Invalid regexp: "Unmatched ) or \\)" and [0-9]*\\) replaces 0 matches. in ...
Luctins's user avatar
  • 120
0 votes
2 answers
95 views

regexp-builder - no match with correct regexp. Why? [duplicate]

In buffer I has text "ADA-SGD" "ADT-SGD" "ADX-SGD" "AID-SGD" "AMP-SGD" "ANT-SGD" "ARDR-SGD" "ARK-SGD" M-x regexp-builder Input regexp: "\([A-Z]+\)-\([A-Z]+\)" But I get message: No match. Why?
a_subscriber's user avatar
  • 3,916
-1 votes
1 answer
173 views

How to find all characters, newlines included?

I have this LaTeX code: %%% 10 \bibitem{bib2} W.~Kockelmann, G.~Burca, J.F.~Kelleher, S.~Kabra, S.-Y.~Zhang, N.J.~Rhodes et~al., \emph{Status of the neutron imaging and diffraction instrument IMAT},...
Onner Irotsab's user avatar
1 vote
2 answers
140 views

Removing and adding newlines around expressions

I am in the process of formatting a couple of hundred markdown files and am trying to automate that process. I am having two problems, but I guess I can ask two questions ;) Goal I am trying to ...
Øistein Søvik's user avatar

15 30 50 per page