jEdit Community - Resources for users of the jEdit Text Editor
A macro to remove or retain all lines that can find match with supplied regular expression (Retain_Or_Remove_Lines.bsh v1.0 by Jia Zhiming)
Submitted by jiazhimi on Tuesday, 26 October, 2004 - 03:03
Just supply a regular expression, then choose whether to retain or remove the lines that can find match with the regular expression. It will remove all lines that can not find match, or all lines can find a match. Hope you find it useful.

Updated on 10/26/2004 - 10:15
Downloads: 2122

Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Unformats document!
by dj_segfault on Tue, 06/02/2007 - 19:11
When I tried running this on a Java program, all lines were unindented, starting in the first column. Beware.
retain lines that start with a * or a space
by dbarends on Sat, 30/10/2004 - 06:30
It was just the macro I was looking for. I use it for cleaning up alarm files from a process control system.

But when I use the regular expression ^[* ] (watch the space after the *) the macro will retain only the lines with an *. Am I doing something wrong?

Kind regards
Dick Barends
 
if I guess right, you may like to try this:
by jiazhimi on Mon, 01/11/2004 - 08:04
"^\* ", please remove " when you type into text box
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300