I'm a regular expression user from way back, since I can remember the bad
old days when regular expressions were the only decent way to edit a source
file efficiently in vi or (acckkk!) ed. Modern editors provide alternatives
that are usually more efficient, but from time to time I like to pass my
time trying to get a regex right, just to keep my hand in ... or, as in the
case of an edit I want to do right now, because it really would be quicker
than doing the edits manually.
Until now, I've avoided using them in EiffelStudio, tending to jump out to
another tool like Visual Studio where I'm already comfortable with working
with the search-and-replace functionality. But the mood grabbed me just now
to attempt doing the search and replace in EiffelStudio. I came up with the
search string I needed quite easily. One or two false starts, as is usual
for me, but I got it right fairly quickly. The way the "Search for" field
turns pink when there is no match is helpful feedback. Nice.
But I can't get the replacement string right. I want to preserve part of the
match in the replacement string. For example, in Visual Studio I wrap {}
around the part I want to preserve -- for example, {[A-Z0-9_]+} -- and then
I refer to it in the replacement string as 1.
The Search tool's on-line help page doesn't even mention regular
expressions. It looks like it hasn't been updated, because it's still
talking about "wildcards".
So I'm off to Visual Studio to get the job done :-(
- Peter Gummer
.