Loading ...
Sorry, an error occurred while loading the content.

Re: Pre-release #2 of NoteTab 7.0 available

Expand Messages
  • flo.gehrke
    ... It s the same issue with wildcards. For example, test... ^!Info ^$StrReplace( a* ; 000 ; aaa bbb ccc aaa bbb ccc ;*)$ Since * should match 0 or more WORD
    Message 1 of 5 , Mar 29, 2012
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "diodeom" <diomir@...> wrote:
      >
      > 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."

      It's the same issue with wildcards. For example, test...

      ^!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...

      ^!Info ^$StrReplace("a\K+b";"c";"ab";R)$

      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?

      Flo
    • Eric Fookes
      Hi Dio, ... You re welcome :) ... This issue is now fixed in update #3. -- Regards, Eric Fookes http://www.fookes.com/
      Message 2 of 5 , Apr 4, 2012
      • 0 Attachment
        Hi Dio,

        > Wow. I'm elated by the introduction of regex support in
        > ^$StrReplace()$. Thank you, Eric, for granting my primary wish!

        You're welcome :)

        > 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." Plain
        > literal replacements don't heed the absence of A for me either.

        This issue is now fixed in update #3.

        --
        Regards,

        Eric Fookes
        http://www.fookes.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.