How do I kill lines matching a pattern?

How do I kill lines matching a pattern?

Post by Edward O'C » Sat, 21 Feb 2004 04:59:03


> In vi, I would do something like:

Does the command `flush-lines' do what you want?

,----[ C-h f flush-lines RET ]
| flush-lines is an interactive compiled Lisp function in `replace'.
| (flush-lines REGEXP &optional RSTART REND)
|
| Delete lines containing matches for REGEXP.
| If a match is split across lines, all the lines it lies in are deleted.
| Applies to lines after point.
|
| If REGEXP contains upper case characters (excluding those preceded by `\'),
| the matching is case-sensitive.
|
| Second and third arg RSTART and REND specify the region to operate on.
|
| Interactively, in Transient Mark mode when the mark is active, operate
| on the contents of the region. Otherwise, operate from point to the
| end of the buffer.
`----


Ted

--
Edward O'Connor
XXXX@XXXXX.COM
 
 
 

How do I kill lines matching a pattern?

Post by Will Hartu » Sat, 21 Feb 2004 05:05:50

In vi, I would do something like:

:g/pattern/d

and all of those lines would be deleted.

How can I do a similar thing in emacs?

Thanx!

Regards,

Will Hartung
( XXXX@XXXXX.COM )