0
votes
1answer
13 views

Is it possible to extract multiple groups at once when fontifying with font-lock?

I'm trying to wrap my head around font-lock-keywords format, particularly MATCH-ANCHORED variant, but I don't see how would I re-use matches generated from one regexp. Below is my setup for ...
0
votes
0answers
70 views

Emacs rx semantics

I have the constructed the following regular expresion using rx.el module (rx (and bol (0+ (not (any "#" "[]*" "\n"))) " " (or "#" "[]*") " ")) I want to change the string []* for the string ...
4
votes
4answers
344 views

Unicode in an Emacs regular expression

I'm using emacs 24. How can I replace all occurrences of the non-printable Unicode bidi character RTL, whose hexadecimal number is 202e? I want to replace it with the non-printable Unicode bidi ...
1
vote
1answer
39 views

Emacs: How can I delete all hyphenations at the end of lines in a text?

I scanned a pdf with usuall hyphenation at the end of the lines and need to process the text. Example: There are these two young fish swim- ming along and they happen to meet an older fish swimming ...
1
vote
1answer
205 views

About regexp in emacs ediff-directories

I want to compare two directories which have similar hierarchy. With "M-x ediff-directories" within Emacs, I was prompted to input a regexp to constrain the name of files I want to compare. For ...
1
vote
2answers
120 views

Emacs Regex Capture+Replace: (abc (:key map)) -> (abc (-> map :key str))

I have a bunch of (clojure) code that looks like this: (content (:some-key some-map)) I want this code to become: (content (-> some-map :some-key str)) I tried: (content (\(:[-a-z].*\) ...
2
votes
1answer
70 views

Is there a way to let Emacs' regexp based commands such `query-replace-regexp` use Perl regexp?

Is there a way to let Emacs' regexp based commands such query-replace-regexp use Perl regexp? I am hoping there is some reasonably simple way to achieve this, for example, by adding code in .emacs.
2
votes
1answer
229 views

Can I use perl based regular expressions on buffers in emacs?

Emacs regex seems to have a few strange rules like escaping brackets. I'd rather use the perl based regex I've always used.
2
votes
1answer
134 views

Command that behaves like Emacs' align-regexp

Let's say you have a properties file that looks like this: prop1 = value1 longerprop = value2 reallylongpropthathasnomeaning = val3 shorterprop = val4 and you want to "beautify" it into this: ...
2
votes
1answer
806 views

How do you use more than 9 regex capture groups in emacs?

I'm trying to transform a rather long sequence of values to a different format, using emacs' replace-regex command. There are more than 9 values to extract, so the \1 - \9 back references are not ...
4
votes
1answer
184 views

Emacs: How to make regexp search the default for C-s?

How can I change Emacs so that the regexp search (instead of normal search) is the default? I would like to be able to type C-s [0-9], for example, and it takes me to the next number. Then, press ...
0
votes
1answer
167 views

Activating Emacs' kill-ring in Regex-builder

How can you activate Emacs' kill-ring in Regex-builder? My regex " [a-zA-z/0-9-.]*" hilights stuff which I want to be removed. I put the regex to kill ring by C-c C-w. I unsuccessfuly activate the ...