Finding lines which start with the same word

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
gamores
Posts: 1
Joined: Fri Oct 15, 2010 11:16 am

Finding lines which start with the same word

Post by gamores »

I am trying to find search for lines in a document which start with the same word (preceded by a parenthesis). For example,

(robot,[N],[Device,Concrete,Count,Animate])
(robot,[N],[human,count])

so that I can delete duplicates.
The regular expression I am using is
(\([:word:]+\),.*\n^(\1

But it says it is not valid, and don't understand why :x

Thanks
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The way TextPad's regex recogniser handles newlines is very weak. It doesn't allow a \n to be quantified with * or + or {m,n}, or to be contained in a parenthesised expression. And (the one relevant to your example) it doesn't allow a back-reference to refer back over a newline.
Post Reply