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

[Clip] Re: Using the \G assertion

Expand Messages
  • Flo
    ... Sheri, Sorry for not mentioning the selection. With regard to your latest advice, the following clip works for me when run on a multiple line text...
    Message 1 of 25 , Oct 23, 2008
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:
      >
      > If using the ^$GetDoc... functions its not enough to move the
      > cursor, we have to actually make a selection from the desired
      > starting position to the end of the document (or other ending
      > position)...

      Sheri,

      Sorry for not mentioning the selection. With regard to your latest
      advice, the following clip works for me when run on a multiple line
      text...

      ^!Toolbar New Document
      ^!SetWordWrap off
      String for testing the \G assertion
      1719180618191902194920192050
      Matching years of the 20th century
      ^!SetCursor 2:1
      ^!Select EOL
      ^!If ^$Calc(^$GetSelSize$ MOD 4)$ <> 0 Error Else Next
      ^!Info Matches ^$GetDocMatchAll("\G(?:(?!19)\d{4})*(19\d{2})";1)$
      ^!Goto End

      :Error
      ^!Prompt Error: Input Data isn't lines with multiples of four digits

      I hope you will agree with my alternative way of checking 4-digit-
      multiples. It tries to comply with Don's idea in message #18573.

      Flo
       
    Your message has been successfully submitted and would be delivered to recipients shortly.