Variables: using @MacroName in the Find field...
Posted: Tue Dec 21, 2010 1:20 am
I know myself and others over the years have requested the Find/Replace filter be able to to accept a @MacroName in the Find field.
I understand the problem with inserting @MacroName into a Find field, i.e. dealing with literals, escaping and speed, etc.
But what if this approach were possible...
Using filter Find/Replace...below the Find field add an optional checkbox: 'Process variables, i.e. @@MacroName'
This would then tell TextPipe to explicitly process the Find field in a different way than normal.
So if we test this...
Find: @@FName\.@@LName@microsoft\.com
NO='Process variables, i.e. @@MacroName'
TextPipe would search for all literals in this case and likely not find any matches (works exactly like current Textpipe).
Now with...
YES='Process variables, i.e. @@MacroName'
TextPipe would internally create a tab deliminated macro replace list from currently declared macros such as:
@@FName\tSimon
@@LName\tCarter
etc.
Once this internal pre-processing (inserting macros into the Find pattern) is done, then continue with the Find as normal.
Find pattern would then be: Simon\.Carter@microsoft\.com (an unlikely match
If done like this I don't think we have to worry about escaping literals, unless I am missing something.
Will this be slower than 'normal' mode?, yes; but only when explicitly called.
What do you think...is this approach possible?
Thanks,
Brent
I understand the problem with inserting @MacroName into a Find field, i.e. dealing with literals, escaping and speed, etc.
But what if this approach were possible...
Using filter Find/Replace...below the Find field add an optional checkbox: 'Process variables, i.e. @@MacroName'
This would then tell TextPipe to explicitly process the Find field in a different way than normal.
So if we test this...
Find: @@FName\.@@LName@microsoft\.com
NO='Process variables, i.e. @@MacroName'
TextPipe would search for all literals in this case and likely not find any matches (works exactly like current Textpipe).
Now with...
YES='Process variables, i.e. @@MacroName'
TextPipe would internally create a tab deliminated macro replace list from currently declared macros such as:
@@FName\tSimon
@@LName\tCarter
etc.
Once this internal pre-processing (inserting macros into the Find pattern) is done, then continue with the Find as normal.
Find pattern would then be: Simon\.Carter@microsoft\.com (an unlikely match
If done like this I don't think we have to worry about escaping literals, unless I am missing something.
Will this be slower than 'normal' mode?, yes; but only when explicitly called.
What do you think...is this approach possible?
Thanks,
Brent