Jamal Mazrui wrote:
>Thanks, Don--I appreciate the tips and examples. Can you describe the
>approach you take generally? I infer that you make use of the ^ at the
>beginning of a line, the $ at the end, and a [^ ] type of expression as
>much as possible. In conceptual terms if possible, what enables these
>techniques to defeat the greedy problem?
The technique involves using a wild-card that will stop the search at
it's first occurent, thereby preventing the greediness from doing me
in. If I want to stop on the first occurence of, say "x", in a given
line I search for "^[^x]*x". this means, starting a the beginning of the
line (^), find any sequence of zero or more characters NOT equal to "x"
followed by an "x". Thus in the following line:
now is the time to get an x-ray of my teeth
The search would select:
now is the time to get an x
The following quote from the NoteTab help file (the regular one, not the
one for Clip Programming) explains the use of the square brackets and
the caret inside:
A string enclosed in brackets  specifies a character class. Any single
character in the string is matched. For example, [abc] matches an a, b,
or c. Ranges of ASCII letters and numbers can be abbreviated as, for
example, [a-z0-9]. If the first symbol following the [ is a caret (^)
then a negative character class is specified. In this case, the string
matches all characters EXCEPT those enclosed in the brackets. For
example, [^a-z] matches everything except lower case characters (and
The use of ^ and $ outside of  to stand for the line beginning and end
is also discussed there.
Hope this explanation helps. If not, feel free to ask more.