I'm using UE 13.10a+1.
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: while Javascript implementations in browsers or MS-Scripting host since years allow RegExp objects to be created with
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:
It found only occurences of "|"
Next I tried character classes:
did nothing - and no error.
Next try:
told me: "You have entered an invalid expression".
The identical regular expression entered in the Find dialog (with Perl regExp enabled) WORKS
Next try:
worked as expected.
Next try:
worked as expected.
Last try:
did nothing - and no error.
Anything I've overseen?
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("\[|\]");
Next I tried character classes:
Code: Select all
UltraEdit.activeDocument.findReplace.find(/[\[\]{}{)]/);
Next try:
Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[\]{}()]");
The identical regular expression entered in the Find dialog (with Perl regExp enabled) WORKS
Next try:
Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[{}()]");
Next try:
Code: Select all
UltraEdit.activeDocument.findReplace.find("[\]{}()]");
Last try:
Code: Select all
UltraEdit.activeDocument.findReplace.find("[\[\]]");
Anything I've overseen?