In UltraEdit I enabled UNIX-style regular expressions, but finding .*
does not work; only .+
will find something.
Why, and how can I make it work?
I should add that I am working with UltraEdit 11.10b. Is there a known bug or something?
.
matches any character except carriage return and line-feed.
*
matches preceding expression 0 or more times, but non greedy.
Non greedy means as less characters as possible to get a positive result for the expression.
The expression .*
makes sense only between two fixed strings. You cannot use just .*
as nothing matches is a positive match for this expression, too. Any character except line terminators zero times is enough for a positive result for this expression and therefore using just .*
always matches nothing. Or in other words: nothing found is a positive result for the regular expression .*
.
Also word.*
and .*word
are not useful as with those expressions just word
is found or you get unpredictable results.
With .*
or .+
within a search string the find engine always needs a fixed string before and after, or a non matching anchor like ^
or $
to know where to start selecting any character except line terminators 0 respectively 1 or more times.
By the way: The Unix regular expression engine of UE v11.10b is just the UltraEdit regular expression engine used with syntax of Perl regular expression. This explains also why the Unix regular expression engine supports only what the UltraEdit regular expression engine supports, just with a different set of special characters. You should think about an upgrade of UltraEdit to current version 21.10 which has the real Perl regular expression engine in latest version included with all the powerful capabilities of this regular expression engine.