It applies to the highlight scoping. For instance, if you want the regex to only be applied to “strings”, you set the scope as “string”. Then RegReplace finds all of the parts of your file that are of the “string” scope, and applies the regex to them individually.
Like if I want to target strings for changing their quote style:
[pre=#232628] // Swap quotes
“swap_quotes_to_single”: {
“scope”: “string”,
“find” : “^”(.?)"$",
“replace”: “’\1’”,
“greedy_replace”: false
},
“escape_single_quotes”: {
“scope”: “string”,
“find” : “^(”.?(?<!\\))((?:\\]{2}))’(.?")$",
“replace”: “\1\2\’\3”,
“greedy_replace”: false,
“multi_pass_regex”: true
},
“unescape_double_quotes”: {
“scope”: “string”,
“find” : “^(’.?(?<!\\))((?:\\]{2}))\\”(.*?’)$",
“replace”: “\1\2”\3",
“greedy_replace”: false,
“multi_pass_regex”: true
},[/pre]
[pre=#232628] // Flip Quotes
{
“caption”: “Replace: Swap Quotes to Single”,
“command”: “reg_replace”,
“args”: {“replacements”: “escape_single_quotes”, “swap_quotes_to_single”, “unescape_double_quotes”], “find_only”: true}
},[/pre]
etc.
Hope that helps.