deleting multiple lines at a time in the "Find what&quo

General questions about using WildEdit

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
ethib2000
Posts: 2
Joined: Wed Jul 28, 2004 3:26 pm

deleting multiple lines at a time in the "Find what&quo

Post by ethib2000 »

Hi,

In a text file I have multiple lines that I want to delete. I am using the begening of a line command to get rid of these lines. But It looks like I have to paste one command at a time to make it work. I would like to paste all of these regex to delete the lines that I want.

^Unique Visitor.*?$
^Visitors Who Visited Once.*?$
^Visitors Who Visited More.*?$
^Average Visits per Visitor.*?$

Instead of

^Unique Visitor.*?$

make it run than delete than the next one

^Visitors Who Visited Once.*?$

etc.. ect..


Is there something missing in my expression?


Thanks
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

From WE's help file:
Alternatives Alternatives occur when the expression can match either one sub-expression or another, each alternative is separated by a "|", or by a newline character if that option is set. Each alternative is the largest possible previous sub-expression; this is the opposite behavior from repetition operators.
Examples:
"a(b|c)" could match "ab" or "ac".
"abc|def" could match "abc" or "def".
So you're looking at something like
^(Unique Visitor)|(Visitors Who Visited Once)|(more options...).*?$
HTH
Then I open up and see
the person fumbling here is me
a different way to be
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

s_reynisson wrote:
Alternatives ... Each alternative is the largest possible previous sub-expression...
So you're looking at something like
^(Unique Visitor)|(Visitors Who Visited Once)|(more options...).*?$
You need to adjust the parentheses so that the first alternative doesn't include the "^" and the last one doesn't include the ".*?$":

Code: Select all

^(Unique Visitor|Visitors Who Visited Once|more options...).*?$
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

To something like this perhaps?

Code: Select all

^((Unique Visitor)|(Visitors Who Visited Once)|(more options...)).*?$
ben_josephs wrote:You need to adjust the parentheses so that the first alternative doesn't include the "^" and the last one doesn't include the ".*?$":

Code: Select all

^(Unique Visitor|Visitors Who Visited Once|more options...).*?$
Then I open up and see
the person fumbling here is me
a different way to be
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

s_reynisson wrote:

Code: Select all

^((Unique Visitor)|(Visitors Who Visited Once)|(more options...)).*?$
The inner parentheses serve no purpose unless you need to capture the particular alternative subexpression that matched, for use in the replacement, either in a matched subexpression expression ($N) or in a conditional expression expression ($NE:E).
Post Reply