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

Re: [Clip] Dot matches newline ON or OFF (was Re: Non printing characters.)

Expand Messages
  • Axel Berger
    ... Are those the same? What I tend to do in cases like that is to first mask the things I want to keep, by e.g. renaming to
    Message 1 of 16 , Apr 20, 2013
    • 0 Attachment
      hitch@... wrote:
      > And I cannot simply regex *all* the spans, because some goodly
      > number of the spans--at least half--are legit, and shouldn't be
      > removed or altered.

      Are those the same? What I tend to do in cases like that is to first
      mask the things I want to keep, by e.g. renaming to <xspan, alter
      everything else, and rename my kept ones back.

      > Believe me, if the spans weren't different each and every time,
      > OF COURSE I would create a clip that I could deploy with a click.

      I do believe you. But as stated I have replayed what you described as
      exactly as I could and for me it worked flawlessly. Until I can
      reproduce your problem I can't begin to think of a workaround. As John
      said, give us a) a sample text, b) a find string, and c) a replace
      string that don't work and thus reproduce your problem and we can begin
      to concoct a solution.

      Until that time all I can say is, it works as it should, I don't see
      what your problem is. That is not doubting you that there is one, it's
      just being incapable of reproducing it.

      Axel
    • Art Kocsis
      ... Why is because (from what you have told us), it is a perfect application for a clip using RegEx. .* is exactly what ANYTHING that somebody in their
      Message 2 of 16 , Apr 20, 2013
      • 0 Attachment
        At 4/19/2013 05:18 PM, Hitch wrote:
        >With the named span inserted where the "italic span" text is now. When I say that this is a 'clip,' I keep it stored in my clips, but as it's never the same (the name and other material for the span can be ANYTHING that somebody in their brain thought up, any name for the span, any font, etc.), it's not viable as a regular "clip." I mean, I could automate it, to the pasting, but...why?
        >
        >So, I copy-and-paste the name of the span, e.g.:
        >
        ><span style='font-family:"Times New Roman Italic","serif"'>(.*?)</span>
        >
        >then select regex, and then, in the replace box, I've simply always put:
        >
        ><i>$1</i>


        "Why" is because (from what you have told us), it is a perfect application for a clip using
        RegEx. ".*" is exactly what "ANYTHING that somebody in their brain thought up" matches.

        ^!Replace "(?s)<span\s[^>]*?>(.*?)</span>" >> "<i>$1</i>" IHRS

        When you see a $n (n=digit), in the result it means the referenced capture substring is undefined. Note: a null string is still defined.


        Now this is very strange!! The find works fine but the replace is going bananas.
        The result of that command on your test line is:

        <i>(.*?)</i>

        The parenthesis meta characters are being treated as ordinary characters.

        Stranger still (added alternate pattern and set min capture to 1):

        ^!Replace "(?s)<span\s[^>]*?>(.+?|ZZZ)</span>" >> "<i>$1</i>" IHRS

        Applied to (added "Z" between ">" and "("):

        <span style='font-family:"Times New Roman Italic","serif"'>Z(.*?)</span>

        Still results in:

        <i>Z(.*?)</i>

        OK, full debug mode (grouped tags & escaped ">"), group debug output.

        Command (long line ahead followed by parenthesis verification):

        ^!Replace "(?s)(<span\s[^>]*?\>)(.+?|ZZZ)(</span>)" >> "\r\n\$0='$0'\r\n\$1='$1'\r\n\$2='$2'\r\n\$3='$3'\r\n" IRST
        ( )( )( | )( )

        Test string:

        <span style='font-family:"Times New Roman Italic","serif"'>Z(.*?)</span>

        Command Results:

        $0='<span style='font-family:"Times New Roman Italic","serif"'>Z(.*?)</span>'
        $1='<span style='font-family:"Times New Roman Italic","serif"'>'
        $2='Z(.*?)'
        $3='</span>'

        WIH is going on??? Same behavior with both NTS v5.8/fv & v6.2/fv.
        Why is the (.*?) pattern not being treated as a group yet the other ones are?
        This should have been a quick reply with a simple command the gremlins have attacked again.

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