sane@brutus.cs.uiuc.edu (Aamod Sane) (12/29/89)
One of the things I have found very appealing in vi is the use of regular expressions for things such as "delete upto regexp", "move upto regexp" etc. I could not find any equivalent in gnuemacs for this. How would one go about doing this? I am a newcomer to emacs, so excuse me if this is trivial. Please post or reply to sane@cs.uiuc.edu Thanks Aamod Sane sane@cs.uiuc.edu
kjones@talos.uu.net (Kyle Jones) (12/29/89)
[ Another newcomer looks in vain for Emacs info in comp.editors. *sigh* I'm crossposting to comp.emacs to move this to the right forum. ] Aamod Sane writes: > One of the things I have found very appealing in vi is the use of regular > expressions for things such as "delete upto regexp", "move upto regexp" etc. > I could not find any equivalent in gnuemacs for this. > How would one go about doing this? You use incremental search. The command isearch-forward-regexp is normally bound to ESC C-s. Once executed, "Regexp I-search:" appears in the minibuffer and you simply type in the your regular expression. Emacs will search forward as you type. Typing C-s or C-r will search forward or backward for the regular expression you have entered. Once you have found what you're looking for, type ESC and Emacs will leave point at the end of the regular expression and set the mark where you began searching. At this point you can "delete up to regexp" by typing C-w (kill-region) which will kill all text between the point and the mark.