Page 1 of 1

Replace word pattern

Posted: Sun Sep 05, 2010 8:05 am
by rajeshatbuzz
Hi,
I have following lines in my article. I want to remove only which is coming between []. any help?


Lines...........................

A mob also attacked a cinema hall in Purnia screening films of [33]Marathi directors.[87] After the attack the angry mob[44] announced the start of their “non-cooperation� movement against Marathis.[65]

Posted: Sun Sep 05, 2010 8:10 am
by rajeshatbuzz
One more correction, should be delted all the word including [].

Posted: Sun Sep 05, 2010 1:44 pm
by ben_josephs
Find what: \[[^]]*\]
Replace with: [nothing]

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
You may find it helpful to read TextPad's help on regular expressions, although it's rather brief. Look under
Reference Information | Regular Expressions,
Reference Information | Replacement Expressions and
How to... | Find and Replace Text | Use Regular Expressions.

There are many regular expression tutorials on the web, and you will find recommendations for some of them if you search this forum.

A standard reference for regular expressions is

Friedl, Jeffrey E F
Mastering Regular Expressions, 3rd ed
O'Reilly, 2006
ISBN: 0-596-52812-4
http://regex.info/

But be aware that the regular expression recogniser used by TextPad is very weak compared with modern tools. So you may get frustrated if you discover a handy trick that works elsewhere but doesn't work in TextPad.