Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs regexp replace situation

on emacs

Let say that I have this text:

abcd abcd. 23 where . 2 is important for catching

With \. [[:digit:]] I can catch pattern but how to replace without .

Output should be abcd abcd 23.

like image 391
josifoski Avatar asked Oct 04 '22 02:10

josifoski


1 Answers

You could use capturing groups to retain the numeral.

Replace regexp:  \. ([[:digit:]])
Replace regexp with:  \1

The \1 refers to the numeral captured using ([[:digit:]]).

like image 76
Anirudh Ramanathan Avatar answered Oct 13 '22 11:10

Anirudh Ramanathan