Replace word pattern

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
rajeshatbuzz
Posts: 4
Joined: Mon Aug 30, 2010 7:52 pm
Contact:

Replace word pattern

Post 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]
Build and Release Engineer
scmGalaxy.com
rajeshatbuzz
Posts: 4
Joined: Mon Aug 30, 2010 7:52 pm
Contact:

Post by rajeshatbuzz »

One more correction, should be delted all the word including [].
Build and Release Engineer
scmGalaxy.com
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
Post Reply