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

Re: [Clip] Re: Pre-release #2 of NoteTab 7.0 available

Expand Messages
  • Don
    Wish I was as smart as Dio but I ll keep trying :-) Great improvement. What I would like as my primary wish is to be able to expand the search box so that I
    Message 1 of 5 , Mar 28, 2012
      Wish I was as smart as Dio but I'll keep trying :-) Great improvement.

      What I would like as my primary wish is to be able to expand the search
      box so that I can see my entire Regular Expression. I can make it
      screen width, but not multiline (a wrapping text box in other words
      would be very nice so that when I use Dio's work I can see it all.

      On 3/28/2012 10:21 AM, diodeom wrote:
      > --- In ntb-clips@yahoogroups.com, Eric Fookes <egroups@...> wrote:
      >>
      >> * Updated Clip functions to support regular expressions and wildcards:
      >> ^$StrCount("SubStr";"Str"[;Options])$
      >> ^$StrPos("SubStr";"Str"[;Options])$
      >> ^$StrReplace("SubStr";"Str"[;Options])$
      >>
    • 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 2 of 5 , Mar 29, 2012
        --- 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 3 of 5 , Apr 4, 2012
          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.