A pretty likely thing you’d want to do with a text find is to pull out the version number in a line like this:
#DEFINE productversion “1.0 beta"
I can think of two ways of doing this and they’re both fairly kludgy:
1) Define a search expression (regexp or not) that captures the entire line, then in the OnFindText event, do some second stage string searching to attempt to find the bit between quotes using script. This is ugly because you’re throwing away the power of regexps (unless there’s a way to use them in VBScript that I don’t know about…)
2) Define a search expression like (#DEFINE product version.+”)([^"]+) that puts the version in the $2 placeholder. Problem: You only have access to the placeholders if you’re doing a replace, not a find. Kludgy solution: Put “$2” in the Replace Text field, and in the OnFindText event, store the ReplaceText variable into the actual variable you want, then set ReplaceText=FindText. Downside: The file gets written to, so its date gets updated…
So I request either:
1) Make the placeholders available in scripting (like Match1, Match2…Match9)
2) Explicitly allow matches to be set to variables in the GUI.
Steve
Agreed, thanks. I’ll put both of these on our to-do list.