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

RE: [Clip] Assertion behavior - was - RE: [NTS] Can a Reg Exp handle 123 AND not a|b|c followed by x?

Expand Messages
  • John Shotsky
    Axel, I appreciate the ideas, but my goal is to not make any changes that are not needed, and to not make errors that have to be fixed. Some of my processes
    Message 1 of 10 , May 29, 2012
    • 0 Attachment
      Axel,

      I appreciate the ideas, but my goal is to not make any changes that are not needed, and to not make errors that have to
      be fixed. Some of my processes run over 5 minutes, depending on the size of the input file, so not making any changes
      that are unneeded, and not having to fix errors saves processing time. At some point, I need to find out which processes
      are taking the most time, and see if I can find ways to speed them up.

      But if I WAS to use the cleanup feature you described, I'd do it this way:
      ^!Replace "^<<>>(S>\x20)\K\1" >> "" ARSW
      Regards,
      John
      RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
      Sent: Tuesday, May 29, 2012 09:26
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] Assertion behavior - was - RE: [NTS] Can a Reg Exp handle 123 AND not a|b|c followed by x?


      John Shotsky wrote:
      > In the past, I've simply used the (S>\x20)? at the beginning,
      > which has the effect of replacing them even if they are present.

      As expected what you get from me is a primitive solution. What I
      frequently do in cases like this is insert the string regardless and the
      replace it with nothing, if it's double.

      This repairs unescaped ampersands in URLs:
      ^!Set %varURL%=^$StrReplace("&";"&";"^%varURL%";False;False)$
      ^!Set
      %varURL%=^$StrReplace("&amp;";"&";"^%varURL%";False;False)$

      This comments or uncomments HTML:
      ^!Select LINES
      ^!InsertSelect <!-- ^P^$GetSelection$-->^P
      ^!Replace "<!-- ^P<!-- ^P" >> "" HASTI
      ^!Replace "-->^P-->^P" >> "" HASTI
      ^!Goto EXIT

      In all cases where the wrong thing is easy to find and easy to undo I
      don't put effort into doing the right thing only. So why not

      ^!Replace "^P<<>>S>S>" >> "^P<<>>S>" WASTI

      Axel



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.