掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 378|回复: 0

[教程] powerpreg 004

[复制链接]

该用户从未签到

发表于 2017-11-20 19:01:35 | 显示全部楼层 |阅读模式
Action Part: Extra Processing
' ?! a3 A: p. }) h5 g. M
- P6 a- k' l2 D8 x; l, r/ S3 j
, Y; s, X) r2 y. ?The "extra processing" part of the Action panel is only visible when you've set the action type to "search and replace", rename files or folders, or "collect data". When you mark the "extra processing" checkbox, an extra set of controls for entering search terms appears.1 t' [- d9 ^, M
"Extra processing" is simply a fancy name for an additional search-and-replace. This search-and-replace is not run on a file, but on each replacement text in a search and replace action, or on each text to be collected in a "collect data" action. It is most useful when the main action searches using regular expressions, and replaces or collects text using backreferences. The extra processing step is run after backreferences have already been substituted in the replacement text or text to be collected, giving you a chance to reformat them.
& ?! ^) ^( H/ c# {4 I0 E4 [An example: when collecting data from URLs in the log files of a web server, you'll get back URL-encoded data. E.g. spaces appear as plus symbols, and plus symbols appear as %2B. With an extra processing step, you can search-and-replace the plus symbols back into spaces, etc. making the results a lot more readable.
$ N" r( o' E' W- kDo not confuse extra processing with entering a list of search terms in the main part of a search-and-replace action. Each search-and-replace in the main part of the action is run on the entire file, or the entire section. The extra processing is only run on the replacement text, just before the main action makes a substitution. If the main action uses a list, the extra processing is applied to each replacement made by all items in that list.: x/ q. U* k* M" ^
Examples: Padding replacements, Rename Audio Files Using Meta Data, Rename files based on HTML title tags, Collect XML Data with entities replaced, Convert Windows to UNIX paths and Extract Google search terms from web logs2 p6 k& o6 r) e$ U
Named Capturing Groups Carry Over2 c7 l" [' n: y8 m* l0 N) e( o! k) G
! r0 {1 ?# e9 ^1 S, p, R9 Q
When using regular expressions, named capturing groups carry over from the file sectioning and the main part of the action to extra processing. If the sectioning regex or main regex used a capturing group, you can use a backreference to that capturing group in the regular expression and/or the replacement text used for extra processing.
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

小黑屋|手机版|Archiver|PDAWIKI |网站地图

GMT+8, 2024-4-20 11:16 , Processed in 0.034480 second(s), 10 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表