Page 1 of 1

Reg Expressions Help (I read the FAQ)

Posted: Mon Jun 25, 2001 6:21 pm
by Don
Maybe I've been living in the PC world too long but this regular expression stuff has got me stumped. I've 12,000+ lines of text and I need to do some powerful editing, hence regular expressions came in. If you can help please do.

What I've got:

If DigOut_5_Transport4_Value6 <> Log_DigOut_5_Transport4_Value6 then
Call RoutineX(DigOut_5_Transport4_Value6 ,Log_DigOut_5_Transport4_Value6 ,DigOut_5_Tran sport4_Value6.comment, DigOut_5_Transport4_Value6.EngUnits)
else
Log_DigOut_5_Transport4_Value6=DigOut_5_Transport4_Value6
endif

What to Find

DigOut .EngUnits (where the spaces can be any number of stuff)

Replace the whole thing beginning with DigOut and ending with .EngUnits
with " " (double Quotes)

After Replacing:

If DigOut_5_Transport4_Value6 <> Log_DigOut_5_Transport4_Value6 then
Call RoutineX(DigOut_5_Transport4_Value6 ,Log_DigOut_5_Transport4_Value6 ,DigOut_5_Tran sport4_Value6.comment, " ")
else
Log_DigOut_5_Transport4_Value6=DigOut_5_Transport4_Value6
endif

Any Ideas?

Re: Reg Expressions Help (I read the FAQ)

Posted: Mon Jun 25, 2001 6:29 pm
by Andreas
Replace
Digout[0-9a-zA-Z_]+.EngUnits
by
" "

or
DigOut_[0-9]_Transport[0-9]_Value[0-9].EngUnits
by
" "

Whatever fits your needs better - I do not know enough of the problem to decide..

Re: Reg Expressions Help (I read the FAQ)

Posted: Mon Jun 25, 2001 8:26 pm
by Roy Beatty
Consider putting a backslash (\) before the periods in your find strings.
That will make them literal values to match against. I'm sure it would make no practical difference in this case.

Re: Reg Expressions Help (I read the FAQ)

Posted: Tue Jun 26, 2001 7:40 pm
by don
Thanks for the help, worked like a charm. Looking at your solutions my error was in how I chose to seperate text from commands.

Re: adding numbers to a group

Posted: Fri Jul 20, 2001 8:15 pm
by ron
I am trying to set-up a contact list with a group of phone numbers. I have a list of approx. 10,000 numbers without area codes in an Excel spreadsheet. How can I use Textpad to place a three digit area codes in front of each of these numbers?
Thank you,
Ron

Re: adding numbers to a group

Posted: Wed Aug 01, 2001 6:55 pm
by Adam Glauser
Ron,

Perhaps:
Replace
[0-9]\{3\}-[0-9]\{4\}

with
(place area code here) $

An example of a replacement string would be:
(519) $