I'm not happy with the way I understand RegEx is being implemented in UltraEdit (currently working with 14.00a).
In dealing with a more specific sub-issue, I was told by IDM support that UE handles RegEx on a line-by-line basis, instead of working on the whole document at once. This is unfortunate, because it means that RegEx is going to work incorrectly in many cases - particularly when it involves multi-line parsing.
For example, if you use the following test text (and Perl RegEx):
--------------------------------------
Here we have some...
multiline
text. Here we explore first.
And here we explore last.
this is a green result
green, this result is not
--------------------------------------
The following RegEx does not work. It should match the word "this" if it's at the beginning of a line, but instead, UE says that nothing can be found.
(?<=\r\n)this
The following RegEx also does not work. It should match the word "green" if it's not at the beginning of a line, but instead, UE says that nothing can be found.
(?<!\r\n)green
And if we apply the following RegEx:
(?s)we.*explore
...the way this RegEx is *supposed* to work, is that everything from the word "we" on line 1 to the *second* occurance of the word "explore" on line 7 should be selected. Instead, UE only selects up to the *first* occurance. Making deliberate use of a greedy repetition operator is thwarted because of UE's line-by-line parsing.
What's the point of implementing RegEx, if it's not implemented fully? The question is - is this hardcoded into UE, or is there a way to configure UE to handle RegEx properly?
In dealing with a more specific sub-issue, I was told by IDM support that UE handles RegEx on a line-by-line basis, instead of working on the whole document at once. This is unfortunate, because it means that RegEx is going to work incorrectly in many cases - particularly when it involves multi-line parsing.
For example, if you use the following test text (and Perl RegEx):
--------------------------------------
Here we have some...
multiline
text. Here we explore first.
And here we explore last.
this is a green result
green, this result is not
--------------------------------------
The following RegEx does not work. It should match the word "this" if it's at the beginning of a line, but instead, UE says that nothing can be found.
(?<=\r\n)this
The following RegEx also does not work. It should match the word "green" if it's not at the beginning of a line, but instead, UE says that nothing can be found.
(?<!\r\n)green
And if we apply the following RegEx:
(?s)we.*explore
...the way this RegEx is *supposed* to work, is that everything from the word "we" on line 1 to the *second* occurance of the word "explore" on line 7 should be selected. Instead, UE only selects up to the *first* occurance. Making deliberate use of a greedy repetition operator is thwarted because of UE's line-by-line parsing.
What's the point of implementing RegEx, if it's not implemented fully? The question is - is this hardcoded into UE, or is there a way to configure UE to handle RegEx properly?