matching round braces

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

matching round braces

Post by Nicholas Jordan »

given:
(39)63245986
(40)102334155
(41)165580141
(42)267914296
(43)433494437
(44)701408733
(45)1134903170
(46)1836311903
(47)2971215073
(48)4807526976
(49)7778742049
(50)12586269025

I was trying to remove the (\d+?) and could not get anything to work.
Beginner at regular expressions, this was in the find/replace - some of the stuff I wrote worked ~ some didn't.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

What do you mean by this:
I was trying to remove the (\d+?)

You have given a sample of beginning data, what should the result look like?

Also provide a sample of what you are using for Search and Replace values so that we can help edit it for you.
Hope this was helpful.............good luck,
Bob
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Aha! I think I answered my own question.

the (\d+?) is what you are using for the Search value, digits within parantheses...... Try this for any number of digits between ( )...

Search for: ^\([0-9]*\)
Replace with: nothing

=====================

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

it was helpful

Post by Nicholas Jordan »

I tried some other things with tp find/replace using re's ~ I eventually figured out that the command set for tp/re's is not that of traditional nfa engines discusses in O'Reilly's Mastering Regular Expressions.

I will try character classes, that short list was supposed to be fibonacci for a packing problem ( fixed size limit / multiple datasamples / multiple packing units ) The book I am reading gives algorithm for generating these on the fly in method entry. ( Sedgewick - which is a remarkably readable workup on the matter )

message edit - I just tried it on a find in files and it found a lot of stuff ~ the book I read stated to use +? for most searches calling it lazy : but that construct selected the whole line. One of the cases went degenerate.
Post Reply