Multiple lines

General questions about using TextPad

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

Post Reply
allratings
Posts: 3
Joined: Wed Jul 02, 2008 8:09 pm

Multiple lines

Post by allratings »

What would be the proper expression to find and delete multiple lines? I am not talking about this....
Find=line1(.+)\n(.+)\nline4

I am talking about maybe 100s of lines where I want to delete the content from the two points and the line numbers are not always the same.

Example: This is on line 1 ....<!DOCTYPE html PUBLIC.+
This could be on line 212, 216, 229, etc.... <!--[if lte IE 6]><table><tr><td><![endif]-->

So I want to delete all in between.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The details are not clear, but this might do it:
Find what: (<!DOCTYPE html PUBLIC.+)(?:[\s\S]*?)(<!--\[if lte IE 6\]><table><tr><td><!\[endif\]-->)
Replace with: $1\n$2

[X] Regular expression

Replace All
allratings
Posts: 3
Joined: Wed Jul 02, 2008 8:09 pm

Ben

Post by allratings »

Thank you Ben! That's exactly what I was looking for. That feature was not available in earlier versions of Textpad.
Post Reply