22538Re: Pre-release #2 of NoteTab 7.0 available
- Mar 29, 2012--- In email@example.com, "diodeom" <diomir@...> wrote:
>It's the same issue with wildcards. For example, test...
> Wow. I'm elated by the introduction of regex support in
> ^$StrReplace()$. Thank you, Eric, for granting my primary wish!
> I notice that absence of option A doesn't seem to prevent swapping
> of all matches. For example, if the task were to replace only the
> first occurence of repeated characters:
> ^!Set %x%=foo bar baa
> ^!Set %x%=^$StrReplace("(.)\1";"$1";"^%x%";R)$
> ^!Prompt ^%x%
> My output* is "fo bar ba" instead of anticipated "fo bar baa."
^!Info ^$StrReplace("a*";"000";"aaa bbb ccc aaa bbb ccc";*)$
Since '*' should match 0 or more WORD characters, I expect '000 bbb ccc aaa bbb ccc'. The clip, however, returns '000 bbb ccc 000 bbb ccc' which should happen only if 'A' was set.
Also, the new ^$StrReplace$ doesn't seem to output any error messages in case it contains a RegEx syntax error. You may test it with...
The clip returns 'ab' whereas it should return 'Regex error: nothing to repeat' since '\K' can't be repeated.
Nevertheless, combining more string functions with RegEx is a great improvement! Bravo, Eric! It just needs some more fine-tuning...
So far, it hasn't been made quite clear -- but I've got the impression that NT 7.0 also accepts the old syntax of ^$StrReplace$, isn't it?
- << Previous post in topic Next post in topic >>