User Tools

Site Tools


resources:emacs_resources

This is an old revision of the document!


<2015.6.24>

Regular expressions

(“regexps,” “regexp,” “regex”)

Recipes

Replace single spaces after end of sentence with two spaces.

Type the following:

[M-x] query-replace-regexp [RET]
\. \([A-Z]\) [RET]
.  \1 [RET]

Replacement trick ADC used when writing SPM table report tool

(from here)

In output file (“taldaemon_i_plus.td.txt” e.g.), AC used emacs regexp (regular expression) to reformat BA's, and just copied a rectangle to get region descriptions:

[M-x] replace-regexp [RET]
^.*Brodmann area.\([0-9]+\).* [RET]
BA\1
resources/emacs_resources.1435157531.txt.gz · Last modified: (external edit)