假设所有“打印命令脚本”触发器文件当前都打印到 Zebra 打印机:
%BTW% /AF="MyFile.btw" /PRN=”Zebra (1)” /P
%END%
您已经使用现有的“打印命令脚本”触发器文件创建了文件集成,但是希望将打印作业重新定位到 Datamax 打印机。 您无需手动编辑所有触发器文件来更新打印机,只需添加一个“搜索并替换”操作即可实现此目的,该操作将会搜索“ZebraXXX”样式并将其替换为“Datamax”。
如果样式为完全匹配,例如“Zebra”到“Datamax”,那么无需使用正则表达式修改器。 However, if the printing criteria is more complex, a regular expression modifier may be necessary. In this example, the existing Print Command Script trigger files are printing to multiple printers, "Zebra (1)," "Zebra (2)," and "New Zebra." 您希望将打印作业仅从“Zebra (1)”和“Zebra (2)”重定向到“Datamax”。
In this case, regular expression modifiers allow you to execute a more precise search.
To add regular expression modifiers to a Search and Replace action
-
In the Options section of the Search and Replace property page, select Use Regular Expression from the Search Method dropdown list.
-
In the Search for box, type “Zebra”.
-
立即在字母“a”后面找到光标。
-
单击
并从正则表达式修改器列表中选择“?”。
-
再次单击
并从正则表达式修改器列表中选择“*”。
“搜索”框中的结果为““Zebra.*”
”。 通过此设置可以指定“Zebra”后跟随任意字符,直到到达双引号字符。
-
“.”
字符将会匹配任意单个字符。
-
“*”
字符将会匹配 0 或多次。
By combining "."
and "*"
into “Zebra.*”
, your search will match double-quote plus Zebra plus any number of trailing characters until the end double-quote is reached. 在触发器文件中找到这些实例时,他们将被替换为“Datamax”。