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

4.95 to 5+ Regex conversion aid

Expand Messages
  • Sheri
    I made a couple of clips to aid in converting regular expressions written for 4.95
    Message 1 of 1 , Oct 11, 2006
    View Source
    • 0 Attachment
      <http://tech.groups.yahoo.com/group/ntb-
      clips/files/RegexConversionAid.htm>

      I made a couple of clips to aid in converting regular expressions
      written for 4.95 and earlier to 5+ syntax. Although it won't fix
      every issue that may arise in making the clip actually function as
      before, it should address simple situations. It will work, for
      example with the cdplayer sort clip recently posted for conversion.

      You can see the clips without Yahoo line breaks from the link above.
      If you copy from there using MSIE or Firefox with the IE Tab
      extension, copy the clips one at a time or you will pick up spaces
      on the empty lines between the clips.

      The first clip calls the second one, or you could highlight sections
      yourself where it is "safe" to do conversions and run the second
      clip.

      Regards,
      Sheri

      H="Find Next Regex Find or Replace"
      ;2006-10-11 by Sheri Pierce
      :Start
      ^!SetWordWrap Off
      ^!Find "^(\^\!(Find|Replace).*?R[^ "\r\n]*(?=\r\n))|((?<=^\^\!
      IfMatch ").*?(?=" .*))" RIS
      ^!IfError NoMore
      ^!Skip Process conversion within displayed highlight?
      ^!Goto Skip_1
      ^!Clip "Convert regex"
      ^!Jump Select_End
      ^!Continue Find Next?
      ^!Goto Start
      :NoMore
      ^!Prompt No more regex commands found.
      ;end of clip

      H="Convert regex"
      ;2006-10-11 by Sheri Pierce
      ^!SetWordWrap Off
      ^!If ^$GetSelSize$=0 Error
      ^!Replace "\\n" >> "\\r\\n" RAHS0
      ^!Replace "\\(\d)" >> "\$$1" RAHS0
      ^!Replace "\\B" >> "\\S" RAHS0
      ;next is ampersand to $0
      ^!Replace "\x26" >> "\x240" RAHS0
      ^!Replace "\\s" >> "\x20" RAHS0
      ^!Replace "\\p" >> "\x7C" RAHS0
      ^!IfTrue ^$IsEmpty(^$GetDocMatchAll("\^\?\{";0)$)$ Next Else Error2
      ^!Replace "\{" >> "\(" RAHS0
      ^!Replace "\}" >> "\)" RAHS0
      ^!Goto End
      :Error
      ^!Prompt Error No Text Selected
      ^!Goto End
      :Error2
      ^!Prompt Cannot convert curly braces because it appears some are
      used in clip wizards within this highlight.
      ;end of clip
    Your message has been successfully submitted and would be delivered to recipients shortly.