Steve: It is not a literal string. In the Find / Replace / Find-in-files dialogs there is a Regular Expression checkbox. Put a checkmark in it and try it again.
Ron:
"^" at the beginning of a string anchors the expression to the beginning of a text line, that is, it looks for the pattern following the ^ to start at the top of the file or just after a newline character.
Re: \{4\}, (curly braces) note that you asked me about \(4\) (parentheses), which is (are?) very, very different. Here is the explanation for "\{count\}" from TextPad's help topic, "How to Use Regular Expressions" : Matches the specified number of the preceding characters or expressions. Example: ho\{2\}p matches hoop, but not hop.
Regarding "[...]", I quote again from the same help topic: Any one of the characters in the brackets, or any of a range of characters separated by a hyphen (-), or a character class operator (see below). Examples: h[aeiou][a-z] matches hat, hip, hit, hop, and hut; [A-Za-z] matches any single letter; x[0-9] matches x0, x1, …, x9.
Since I wanted to match any digit, I used [0-9] withhout the x prefix (indicating a match on hex values). I could have used [0-9][0-9][0-9][0-9] or [[:digit:]]\{4\} but [0-9]\{4\} was the shortest alternative.
"Where did you learn the methodology you used above?"<br>
In 1996 or so, about *two years* after I got my TextPad license, I recall reading one person helping another with a find/replace operation similar to something I needed. I do not recall whether that exchange took place on Usenet, a Perl site, or an earlier manifestation of this forum (compuserve?). I took regex seriously from that point on. I can safely say that every hour I studied regex has saved me at least ten.
I recommend three sources to help you learn about regular expressions: <br>
1. The TextPad Help file (search on "regular"). <br>
2. A Regex FAQ maintained by that TextPad illuminary and all-round great fellow, Jeff Epstein: <br>
http://jeffyjeffy.com/textpad/documenta ... aq.html<br>
3. When you *really* get hooked, get hold of the O'Reilly book, Mastering_Regular_Expressions by Jeffry Friedl.
The only down-side to my addiction to regex has been to ignore some unrelated and very useful TextPad functionality. For example, a few months ago someone asked if TextPad could insert a column of line numbers with leading zeroes. I immediately turned to discovering a regex solution. Someone else pointed out TextPad's Edit > Fill Block function which is specifically designed for that purpose.
Well, enough of this unabashed geekiness.
Good luck,
Roy