Glad to have got a powerfull scripting engine - I never liked UE Macros as "programming language" - I've found that the Perl regular expression engine within Javascript behaves very strange.
First I've wondered, why there is an extra object/method to use:
- Code: Select all
UltraEdit.activeDocument.findReplace.regExp = true;
UltraEdit.activeDocument.findReplace.find
- Code: Select all
new RegExp("expr","flags") or with /expr/flags
I've even tried them, without error messages, but also without success.
Then I tried to write a little script to create proper idented javascript object from my Firefox "sessionstore.js", where the identation should be increased after the characters "{[(" and decreased before "}])". The first try was:
- Code: Select all
UltraEdit.columnModeOff;
UltraEdit.hexOff;
UltraEdit.perlReOn;
UltraEdit.activeDocument.findReplace.regExp = true;
UltraEdit.activeDocument.findReplace.find("\[|\]");
It found only occurences of "|"
Next I tried character classes:
- Code: Select all
UltraEdit.activeDocument.findReplace.find(/[\[\]{}{)]/);
did nothing - and no error.
Next try:
- Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[\]{}()]");
told me: "You have entered an invalid expression".
The identical regular expression entered in the Find dialog (with Perl regExp enabled) WORKS
Next try:
- Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[{}()]");
worked as expected.
Next try:
- Code: Select all
UltraEdit.activeDocument.findReplace.find("[\]{}()]");
worked as expected.
Last try:
- Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[\]]");
did nothing - and no error.
Anything I've overseen?




