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

RE: Clip Error Question

Expand Messages
  • John Shotsky
    This problem has been solved, with the excellent detective work of Dio. The cause of the problem occurs in a line that is after the GoTo Exit that I placed to
    Message 1 of 6 , May 10 6:05 AM
    • 0 Attachment
      This problem has been solved, with the excellent detective work of Dio. The cause of the problem occurs in a line that
      is after the GoTo Exit that I placed to stop operation, which is why I would not have looked past that point. In this
      case, that other line has a caret inside a character class:



      ^!Replace "\b(\d{3})[\"\'\*~\^](\x20|\.|\))" >> "$1°$2" ARSTW



      That character, just by being before the ], and even though it is escaped, causes NT to misconstrue the ], which then
      causes the problem way upstream. The solution is to use the hex notation, or move the caret away from the ]. Apparently,
      NT reads the entire clip library, and somehow gets confused with that caret in that location.



      If you're wondering what that clip does, it replaces some of the different symbols I've found that people use for the
      degree symbol in recipes with the real degree symbol. Others are fixed at the character level, but these need context to
      detect them.



      Thanks again Dio and all,

      John



      From: John Shotsky [mailto:jshotsky@...]
      Sent: Monday, May 09, 2011 10:05
      To: ntb-clips@yahoogroups.com
      Subject: Clip Error Question



      I am getting a syntax error on a clip but I don't understand what I'm doing wrong.

      The clip is supposed to remove brackets around a period [.] when followed by a specific pattern.

      The \K is in place to not capture the first part, and parens are around the second part to capture it.

      However, if I don't use parens around the first range, it gives an error

      ^!Replace "^[\dA-Z].+\K\[\.\](.+[A-Za-z][A-Za-z][A-Za-z][A-Za-z]\d\d[A-Za-z])" >> "\.$1" AIRSTW



      If I put parens around the first range, it works normally.

      ^!Replace "^([\dA-Z]).+\K\[\.\](.+[A-Za-z][A-Za-z][A-Za-z][A-Za-z]\d\d[A-Za-z])" >> "\.$2" AIRSTW



      If I remove the caret ^, it also doesn't produce an error without the parens.



      Note that the pattern I'm trying to capture isn't present in the text – this is a clip syntax error. As I look at the
      error string, it is clear that the first [ is being interpreted as a literal character instead of the beginning of a
      range, because it gives a number followed by the close range. (]) (and then all the other ranges do the same thing.) I
      don't know if that's my error or a NoteTab error. Can you not reliably start a range at the beginning of a line unless
      it is within parens?



      This all came about as I was doing some code cleanup, removing parens before \K when not needed. When I tested, this
      came up, and replacing the parens or removing the caret were the only ways to get it to work. I looked in the help but
      didn't see anything that applied.



      Oh, and by the way, it would be great if error messages could by copied as text…



      Thanks,

      John





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