Apply Script Function – Regular Expressions Reserved Characters Example

Two transformational scripts, suitable for the Apply Script function, are included with the distribution of Search and Replace.

srch_re.srs can be used to change the reserved characters for regular expression search to their literal counterparts. For example, if you use a search term involving the string “c:\windows\system” in a regular expression the “\” characters must be doubled to denote the literal. srch_re.srs can be used to accomplish this.

repl_re.srs can be used to change the reserved characters for a regular expression replace to their literal counterparts. For example, in a regular expression replacement the “%” character normally denotes the %n operator. A replacement involving, say, “100%” might cause problems unless “100\%” is used in the replace term. repl_re.srs can be used to accomplish this.

Also see: [HTML Example] [RTF Example] [Apply Script Function Overview]

Apply Script Function – Regular Expressions Reserved Characters Example