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

Brooding about ^$GetDocMatchAll

Expand Messages
  • jonas_ramus
    According to the Help File, ^$GetDocMatchAll finds all matching strings based on the supplied regexp pattern . Look at the words: Hickory Dickory Dock When
    Message 1 of 35 , Jan 8, 2007
    • 0 Attachment
      According to the Help File, ^$GetDocMatchAll "finds all matching
      strings based on the supplied regexp pattern".

      Look at the words: Hickory Dickory Dock

      When executing...

      ^!SetListDelimiter ^p
      ^!SetArray %Text%=^$GetDocMatchAll(".{0,3}kory.{0,3}")$
      ^!Toolbar New Document
      ^!InsertText ^%Text%

      I would expect to get...

      Hickory Di
      Dickory Do

      Actually, the result is

      Hickory Di
      ckory Do

      In the second string, I'm missing the "Di". When executing...

      ^!SetArray %Text%=^$GetDocMatchAll(".{3}kory.{3}")$

      the second string has vanished at all. Did I missunderstand that
      command? Thanks for any help.

      Flo
    • jonas_ramus
      ... Sheri, thanks - I should have noticed that by myself! With another r n it s perfect now. ... That s it! Those who don t want to remove these spaces may
      Message 35 of 35 , Jan 17, 2007
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
        >
        > Hi Flo,
        >
        > There should only be one difference between the two replace commands
        > (inclusion or exclusion of the \b's) but the second one is missing
        > the critical \r\n

        Sheri, thanks - I should have noticed that by myself! With another
        \r\n it's perfect now.

        > You also might want to close up the spaces in the replacement
        > clause, they will create extra spaces in the output.

        That's it! Those who don't want to remove these spaces may define a
        left context with ^!Set %Char_left%, and a right context with ^!Set %
        Char_right%=^$Calc(^%Char_left%-2)$ in order to get the same size of
        context on both sides.

        Thanks again for all the help from Alec and you in developing this
        clip!

        Flo

        PS Get well soon with your cold!
      Your message has been successfully submitted and would be delivered to recipients shortly.