Page 1 of 1
matching round braces
Posted: Wed Feb 13, 2008 3:59 am
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.
Posted: Wed Feb 13, 2008 4:42 am
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.
Posted: Wed Feb 13, 2008 4:46 am
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
-----------------------------------------
it was helpful
Posted: Thu Feb 14, 2008 9:28 pm
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.