Search and replace expression

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Siaruzb
Posts: 20
Joined: Thu Jul 27, 2006 6:02 pm

Search and replace expression

Post by Siaruzb »

Hi,

I have following commands in my program:

+ M2 [STDDEV F40.1]
…
+ M30 [STDDEV F40.1]
..
+ M42 [STDDEV F40.1]
…

I have to take out all this expressions from my text. I mean I would like to search and replace “+ M* [STDDEV F40.1]� with “ �.

Please advise how can I do that?

Thanks.
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

You need to perform the following search and replace:

Find:
\+ M[0-9]+ \[STDDEV F40.1\]
Replace:
BLANK
With regular expression enabled and using POSIX regular expression syntax.

This is basically what you suggested but using a class [0-9] to define the numbers, this is repeated at least once +. Some of the characters you are searching for have specific meaning in a regular expression so they need to be made literal using \.

Hope this helps.
Last edited by SteveH on Mon Jan 15, 2007 1:00 pm, edited 1 time in total.
Siaruzb
Posts: 20
Joined: Thu Jul 27, 2006 6:02 pm

Thank you very much...

Post by Siaruzb »

It works! Thank you very much...
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

No problem. Glad to help.
Post Reply