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

Re: [Clip] Help with RegExp

Expand Messages
  • Sheri
    Hi Alec, When NoteTab gives a regex error, it is only ever referring to the search side of a replace command. You have some unescaped asterisks there,
    Message 1 of 12 , Jan 4, 2007
    • 0 Attachment
      Hi Alec,

      When NoteTab gives a regex error, it is only ever referring to the
      search side of a replace command.

      You have some unescaped asterisks there, especially the first
      character. I haven't tested it, but it looks like a problem to me:

      > "*<strong>Details:</strong>*.*\*(.*)"

      Regards,
      Sheri
    • Alec Burgess
      Sheri,Lee: It looks like Thunderbird was munging what I sent (I think recognizing the strong tag in angle brackets and trying to help by putting the
      Message 2 of 12 , Jan 4, 2007
      • 0 Attachment
        Sheri,Lee: It looks like Thunderbird was munging what I sent (I think
        recognizing the strong tag in angle brackets and trying to "help" by
        putting the asterisks around them (the normal way to signal emphasis
        when sending text email) (underlines similarly are used to mark
        underlines and slashes to mark italics)

        In any case, I'm sending this from the yahoo-groups web interface in
        Firefox 2. Sorry for all the confusion Lee. Here's what I intended to
        send originally (hope it comes through OK):

        ======= (one line)
        ^!replace "<strong>Details:</strong>.*\*(.*)" >> "<strong>Date
        $1:</strong>" rwasi
        ======= (end one line)
        There are only three asterisks in the above, a dot-star, a back-slash
        star and another dot_star in parentheses!

        --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
        >
        > Hi Alec,
        >
        > When NoteTab gives a regex error, it is only ever referring to the
        > search side of a replace command.
        >
        > You have some unescaped asterisks there, especially the first
        > character. I haven't tested it, but it looks like a problem to me:
        >
        > > "*<strong>Details:</strong>*.*\*(.*)"
        >
        > Regards,
        > Sheri
        >
      • junja
        Sending code to people who use Thunderbird for their email can be tricky, in particular over characters. Tb users should check the syntax of any code they
        Message 3 of 12 , Jan 7, 2007
        • 0 Attachment
          Sending code to people who use Thunderbird for their email
          can be tricky, in particular over '>' characters. Tb users
          should check the syntax of any code they copy and paste
          which contains '>' characters against the original email.
          junja


          Alec Burgess wrote:
          > Sheri,Lee: It looks like Thunderbird was munging what I sent (I think
          > recognizing the strong tag in angle brackets and trying to "help" by
          > putting the asterisks around them (the normal way to signal emphasis
          > when sending text email) (underlines similarly are used to mark
          > underlines and slashes to mark italics)
          >
          > In any case, I'm sending this from the yahoo-groups web interface in
          > Firefox 2. Sorry for all the confusion Lee. Here's what I intended to
          > send originally (hope it comes through OK):
          >
          > ======= (one line)
          > ^!replace "<strong>Details:</strong>.*\*(.*)" >> "<strong>Date
          > $1:</strong>" rwasi
          > ======= (end one line)
          > There are only three asterisks in the above, a dot-star, a back-slash
          > star and another dot_star in parentheses!
          >
          > --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
          >> Hi Alec,
          >>
          >> When NoteTab gives a regex error, it is only ever referring to the
          >> search side of a replace command.
          >>
          >> You have some unescaped asterisks there, especially the first
          >> character. I haven't tested it, but it looks like a problem to me:
          >>
          >>> "*<strong>Details:</strong>*.*\*(.*)"
          >> Regards,
          >> Sheri
          >>
          >
          >
          >
          >
          > Fookes Software: http://www.fookes.us, http://www.fookes.com
          > Fookes Software Mailing Lists: http://www.fookes.us/maillist.htm
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
        • Lee Underwood
          Alec, This works except it includes the entire rest of the portion (making it all bold). Here is a sample of what I have to change (portions to be changed are
          Message 4 of 12 , Jan 8, 2007
          • 0 Attachment
            Alec,

            This works except it includes the entire rest of the portion (making
            it all bold). Here is a sample of what I have to change (portions to
            be changed are in red):

            <strong>Title:</strong> <a name="Credit_Card_Number_Validation"
            href="http://javascript.internet.com/forms/credit-card-number-validation.html">Credit
            Card Number Validation</a><br><strong>Contributor:</strong> David
            Leppek</a> <br><strong>Contributor URL:</strong> <a
            href="https://www.azcode.com/Mod10">https://www.azcode.com/Mod10</a><br><strong>Details:</strong>
            4.97 KB * Uploaded November 7
            2005<br><strong>Description:</strong> Determine if a credit card
            number could be valid before submitting it for real-time online
            authentication. Based on ANSI X4.13, the LUHN formula, aka the Mod 10
            algorithm is used to validate accurate credit card numbers. Heavily
            commented.</p><p class="listingalign" align="right">[ <a
            href="http://javascript.internet.com/forms/credit-card-number-validation.html#source">Get
            Source Code</a> ]
            <hr noshade size="2">


            Here is what I want to change it to:


            <strong>Title:</strong> <a name="Credit_Card_Number_Validation"
            href="http://javascript.internet.com/forms/credit-card-number-validation.html">Credit
            Card Number Validation</a><br><strong>Contributor:</strong> David
            Leppek</a> <br><strong>Contributor URL:</strong> <a
            href="https://www.azcode.com/Mod10">https://www.azcode.com/Mod10</a><br><strong>Date
            Uploaded:</strong> November 7 2005<br><strong>Description:</strong>
            Determine if a credit card number could be valid before submitting it
            for real-time online authentication. Based on ANSI X4.13, the LUHN
            formula, aka the Mod 10 algorithm is used to validate accurate credit
            card numbers. Heavily commented.</p>
            <hr noshade size="2">



            I hope that a bit more clearer. I tried changing yours but I haven't
            a clue. Once I get this done I'm jumping in full-speed into RegEx.
            It's kind of like when I was a kid and learning math, it took a bit
            and then, bam! I got it!

            Thanks for your help.

            Lee



            On 1/4/2007 08:49 PM, Alec Burgess wrote:
            ........................................................

            >Sheri,Lee: It looks like Thunderbird was munging what I sent (I think
            >recognizing the strong tag in angle brackets and trying to "help" by
            >putting the asterisks around them (the normal way to signal emphasis
            >when sending text email) (underlines similarly are used to mark
            >underlines and slashes to mark italics)
            >
            >In any case, I'm sending this from the yahoo-groups web interface in
            >Firefox 2. Sorry for all the confusion Lee. Here's what I intended to
            >send originally (hope it comes through OK):
            >
            >======= (one line)
            >^!replace "<strong>Details:</strong>.*\*(.*)" >> "<strong>Date
            >$1:</strong>" rwasi
            >======= (end one line)
            >There are only three asterisks in the above, a dot-star, a back-slash
            >star and another dot_star in parentheses!
            >
            ........................................................

            [Non-text portions of this message have been removed]
          • Sheri
            Try it this way: ^!Replace (?s)( .*?)Details:.*?( ).+?(Uploaded) $1Date $3$2 RAWS0 can also be written so it defaults to Ungreedy to
            Message 5 of 12 , Jan 8, 2007
            • 0 Attachment
              Try it this way:

              ^!Replace "(?s)(<strong>.*?)Details:.*?(</strong>).+?(Uploaded)" >>
              "$1Date $3$2" RAWS0

              can also be written so it defaults to Ungreedy to avoid needing the
              question marks:

              ^!Replace "(?sU)(<strong>.*)Details:.*(</strong>).+(Uploaded)" >>
              "$1Date $3$2" RAWS0

              Regards,
              Sheri
            • Lee Underwood
              Sheri, Thanks! That works great! I was also able to adapt it for another change. I ll take a dissect it to get a better understanding. Thanks again. Lee On
              Message 6 of 12 , Jan 9, 2007
              • 0 Attachment
                Sheri,

                Thanks! That works great! I was also able to adapt it for another
                change. I'll take a dissect it to get a better understanding.

                Thanks again.

                Lee




                On 1/8/2007 06:55 PM, Sheri wrote:
                ........................................................

                >Try it this way:
                >
                >^!Replace "(?s)(<strong>.*?)Details:.*?(</strong>).+?(Uploaded)" >>
                >"$1Date $3$2" RAWS0
                >
                >can also be written so it defaults to Ungreedy to avoid needing the
                >question marks:
                >
                >^!Replace "(?sU)(<strong>.*)Details:.*(</strong>).+(Uploaded)" >>
                >"$1Date $3$2" RAWS0
                >
                >Regards,
                >Sheri
                ........................................................
              Your message has been successfully submitted and would be delivered to recipients shortly.