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

Re: [Clip] stripping links=> clippable

Expand Messages
  • Mike Breiding
    ... Thanks, Axel. That removed the internal links. John, I saved yours to a clip for future use. -Mike
    Message 1 of 8 , Aug 12, 2008
    • 0 Attachment
      Axel Berger wrote:
      > Try:
      > ^!Replace "<a href=".+?>(.+?)</a>" >> "$1" WRAS
      >
      > John's clip was for external links begining with http(s)://
      Thanks, Axel. That removed the internal links.
      John, I saved yours to a clip for future use.

      -Mike
    • John Shotsky
      Mike, Although I see Axel has already responded, you correctly state that the clip I wrote won t work on these lines, because I was expecting external links,
      Message 2 of 8 , Aug 12, 2008
      • 0 Attachment
        Mike,

        Although I see Axel has already responded, you correctly state that the clip I wrote won't work on these lines, because
        I was expecting external links, as in your original example. I have found that it pays to be very specific to prevent
        unwanted consequences, the hard way. My clips typically run on thousands of lines of text, and it really takes
        discipline to write clips that will get every case you care about, but not more. So Axel's clip should do what you want,
        but do review the result for unintended consequences.

        The find and replace dialog is a most useful tool. Open it, click the regex and case checkboxes, then have fun. I often
        build a clip in the Find section, as I did with the one above - Just keep adding elements to the find dialog to make it
        work the way you want, repeatedly hitting the 'Find' button to see all the cases it will find.

        Looking at your examples below, I wonder if you want everything on the line removed except the day abbreviation. If so,
        yet another clip will be required:

        ^!Replace "^.*>(.+)<\/a>.+" >> "$1" ARSTW

        Output:
        Tu
        We
        Th
        Fr

        John

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Mike Breiding
        Sent: Tuesday, August 12, 2008 5:13 AM
        To: ntb-clips@yahoogroups.com
        Subject: Re: [Clip] stripping links=> clippable

        John Shotsky wrote:
        > This is one way to do it:
        > ^!Replace "<a href=\"https?:.+>(.+)<\/a>\>" >> "$1" ARSTW
        >
        Hi John,
        I ran the clip on this html and nothing happened:
        <td width="12%"><a href="/wiki/Tuesday" title="Tuesday">Tu</a></td>
        <td width="12%"><a href="/wiki/Wednesday" title="Wednesday">We</a></td>
        <td width="12%"><a href="/wiki/Thursday" title="Thursday">Th</a></td>
        <td width="12%"><a href="/wiki/Friday" title="Friday">Fr</a></td>
        > You can either add this as a clip, or use it in the find/replace dialog. It works on the whole doc. (W)
        >
        I am not familiar with using clips in the find/replace dialog.
        I could not find anything in the help files.

        Thanks,
        -Mike



        [Non-text portions of this message have been removed]
      • Mike Breiding
        ... Hi John, Thanks for fleshing this out. My apologies for sending you an example (external links) that I was not using! What was I thinking? ... What I am
        Message 3 of 8 , Aug 12, 2008
        • 0 Attachment
          John Shotsky wrote:
          > Mike,
          >
          > Although I see Axel has already responded, you correctly state that the clip I wrote won't work on these lines, because
          > I was expecting external links, as in your original example. I have found that it pays to be very specific to prevent
          > unwanted consequences, the hard way. My clips typically run on thousands of lines of text, and it really takes
          > discipline to write clips that will get every case you care about, but not more. So Axel's clip should do what you want,
          > but do review the result for unintended consequences.
          >
          Hi John,
          Thanks for fleshing this out.
          My apologies for sending you an example (external links) that I was not
          using!
          "What was I thinking?"
          >
          > The find and replace dialog is a most useful tool. Open it, click the regex and case checkboxes, then have fun. I often
          > build a clip in the Find section, as I did with the one above - Just keep adding elements to the find dialog to make it
          > work the way you want, repeatedly hitting the 'Find' button to see all the cases it will find.
          >
          > Looking at your examples below, I wonder if you want everything on the line removed except the day abbreviation. If so,
          > yet another clip will be required:
          >
          > ^!Replace "^.*>(.+)<\/a>.+" >> "$1" ARSTW
          >
          >
          What I am doing is using calendars from WikiPedia for my own purpose.
          What I wanted to do is strip their targets and replace them with mine.
          Here are the examples.
          WikiPedia Calendar: http://en.wikipedia.org/wiki/June_1977#June
          My version:
          http://epicroadtrips.us/dad/journals/travel/usa/central_states_north_trip_june_2-15_1977/central-states-north_trip_june_2-15_1977.php

          Thanks again,
          -Mike


          > Output:
          > Tu
          > We
          > Th
          > Fr
          >
          > John
          >
        • Axel Berger
          ... I wholeheartedly agree. The problem here is that you usually know the specific details of what you re working with in your own material, but it s hard to
          Message 4 of 8 , Aug 12, 2008
          • 0 Attachment
            John Shotsky wrote:
            > I have found that it pays to be very specific to prevent
            > unwanted consequences, the hard way.

            I wholeheartedly agree. The problem here is that you usually know the
            specific details of what you're working with in your own material, but
            it's hard to guess in the group. But then everyone ought to treat
            suggestions given here with due caution anyway, I hope.

            > but do review the result for unintended consequences.

            Please do! Just for one example internal links to #top or whatever will
            be deleted to with my clip.

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