InFive wrote:Hence the question - in SearchReplace.js script, I'm used to, in the field With, write $1 for a group. in TextReplace.js script, I have to use inclined \ -it turns out that the TextReplace.js script does not support advanced regular expression syntax, or I have something mixed up?
For regular expressions SearchReplace.js script uses JScript syntax, TextReplace.js script uses AkelPad syntax.
So you should use:
\0 - entire matched text,
\1 - first captured substring in parentheses,
\2 - second captured substring,
etc.
If "Replace with function" is checked, in function body ("With") you should use:
_s0 - entire matched text,
_s1 - first captured substring in parentheses,
_s2 - second captured substring,
etc.
InFive wrote:такой вопрос - функции, которые можно использовать в скриптах по поиску/замене - есть справочная инфа, как использовать такие функции в таких скриптах? и где брать такие функции?
то есть, хочу научиться использовать функции в скриптах по поиску/замене... что может научить?
See description in TextReplace_function.js script.
Posted: Thu May 12, 2016 7:22 pm
by InFive
KDJ
Thanks for the clarification.
TextReplace_test_for_498.js:
works terribly, I'm talking about the replacement by using batch files.
created a batch file, it just 24 rows. run it on the text size is 25 megabytes. so AkelPad ate up 1.7 gigs of RAM, horror takes to shake ...
just never understood how in a batch file to write a regular expression that will only remove certain text, in the string should be the flag "r", for without this flag, the regular expression is treated as plain text to search for.
I made another batch file, in which all 9 lines, the RAM took just 1 gigabyte. Unfortunately, this script for batch replacements is not suitable ...
for batch replacement I use ScriptTemplate.vbs script from Andrey_Averin ... in it I create templates for replacements for a few thousand lines and copes well and not so creepy consumes memory.
Now imagine that I will create a batch file for the TextReplace(_test_for_498).js script which will include several thousand rows? so my comp "burn".
Unfortunately, alas ...
Posted: Mon May 23, 2016 8:26 pm
by KDJ
InFive
Additional memory is occupied by undo buffer.
Set undo limit to 0 and check it.
Posted: Mon May 23, 2016 9:29 pm
by InFive
KDJ wrote:InFive
Additional memory is occupied by undo buffer.
Set undo limit to 0 and check it.
but I'm not sure what the problem was because of this, because I have the undo limit specified in the value "1". but well, I'll try with a value of "0".
Posted: Tue May 24, 2016 8:15 pm
by KDJ
InFive
I tested memory usage and speed of replacement in AkelPad and Notepad++
AkelPad
---------------------------
Changes will be reflected upon restarting the program.
Akelpad больше не отвечает.
AkelPadManualSettings.js
Fixed: after changing some settings, if appears the message "Changes will be reflected upon restarting the program.", AkelPad hangs.
Required: Scripts plugin v.18.5.
Posted: Sun Jun 05, 2016 5:56 pm
by KDJ
AkelPadDocsView.js PluginText.js
Fixed: if you try to close modified document, then appears the message "Document was modified. Do you want to save it?" and AkelPad hangs.
Required: Scripts plugin v.18.5.
Posted: Sat Jun 11, 2016 5:11 pm
by KDJ
InFive wrote:TextReplace_test_for_498.js:
works terribly, I'm talking about the replacement by using batch files.
created a batch file, it just 24 rows. run it on the text size is 25 megabytes. so AkelPad ate up 1.7 gigs of RAM, horror takes to shake ...
Here is new test version TextReplace_test_for_498.js: KDJ.zip.
Check it with 'Disable "Undo"' option.
Posted: Sat Jun 11, 2016 5:58 pm
by InFive
KDJ wrote:
Here is new test version TextReplace_test_for_498.js: KDJ.zip.
Check it with 'Disable "Undo"' option.