Restrict to when a global variable has a particular value?
Posted: Tue Dec 13, 2011 3:28 am
If one captures a pattern to a global variable, might it be feasible to subsequently use the captured value for a restrict filter?
Example: Suppose I capture this XML attribute early on in the file, then I'd know which "work" I'm dealing with.
Could I then have a subsequent subfilter that only takes certain actions depending on the value of the osisWork variable?
i.e. For a filter to be appled to several very similar works, but with some special cases applicable only to certain works.
Assume that all these works have the same set of input filenames.
Example: Suppose I capture this XML attribute early on in the file, then I'd know which "work" I'm dealing with.
Code: Select all
Comment...
| Capture the value of osisWork
|
+--Restrict to between tags <work>...</work>
| [ ] Include text
| [X] Match case
| Max size: 65536
|
+--Restrict to each line in turn
|
+--Perl pattern [osisWork="(.+)"] with []
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [X] Maximum match (greedy)
| [ ] Allow comments
| [ ] '.' matches newline
| [X] UTF-8 Support
|
+--Perl pattern ["(.+)"] with []
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [ ] '.' matches newline
| [X] UTF-8 Support
|
+--Capture to variable @osisWork
Reset: 1
i.e. For a filter to be appled to several very similar works, but with some special cases applicable only to certain works.
Assume that all these works have the same set of input filenames.