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

22501Re: Can I replace text, depending on other text in the same line?

Expand Messages
  • flo.gehrke
    May 6, 2012
      --- In notetab@yahoogroups.com, "mycroftj" <mycroftj@...> wrote:
      > First, Thanks to Flo for the great answers and examples.
      > I learn more by studying them than anything else...


      > Question: Shouldn't (?=.+KLM) be (?=.*KLM) so KLM directly
      > after ABC is found?

      I didn't take into account that we could meet with a string 'ABCKLM'. Unfortunately, we were never informed of the list the member is trying to process. So we have to adjust the clip to specific needs, of course.

      > Next, I tried the clip even though it looked simple and I thought I
      > understood it but something strange happened and it seems like a bug
      > to me. Please check.

      No bug. 'DEFKLM' or 'KLMDEF' is matched only if, in this specific case, the 'T' option is set:

      ^!Replace "ABC" >> "DEF" HAST

      Cf. the Help on Clip Programming: "If the options T or C are not used, NoteTab will search for whole words if the search criteria does not contain spaces or other word delimiting characters. If the search criteria contains such delimiters, then NoteTab will accept matches that are not whole words."

      With RegEx, as in my proposal meant for the menu command, it's different because, normally, RegEx don't distinguish between substring and whole word unless you use word delimiters.

    • Show all 9 messages in this topic