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

RE: [edit+] Reg Exp Question

Expand Messages
  • Jens Vonderheide
    ... Find what: -----BEGIN PGP SIGNATURE-----(.| n)*-----END PGP SIGNATURE----- Replace with: Nothing or anything you like... Enable Regular expression The only
    Message 1 of 6 , Apr 13 4:11 AM
      > I have a very large text file of compiled e-mails.
      > I am wanting to make it more readable, and clean it up a bit.
      > Question: what regexp would I use to remove the PGP signatures from
      > the text file?
      > Here is an example:
      > -----BEGIN PGP SIGNATURE-----
      > Version: PGP 6.5i
      >
      > iQA/a1b2c3d4/iaOoblahblahblahnumbernumberabcdefghijklmnopH7BcAoMh6
      > qrstuvwxyandz/scoobydoo
      > =AbCd
      > -----END PGP SIGNATURE-----


      Find what: -----BEGIN PGP SIGNATURE-----(.|\n)*-----END PGP SIGNATURE-----
      Replace with: Nothing or anything you like...
      Enable Regular expression

      The only trick here is that . does not include newlines, so you need to
      search for either "any character" or "newline".

      Jens
    • Christoph P�per
      ... The pipe character works as OR in EditPlus? I thought ([. n]*) was the way to go. Didn t test it, though. Christoph
      Message 2 of 6 , Apr 13 8:13 AM
        Jens Vonderheide:
        >
        > Find what: -----BEGIN PGP SIGNATURE-----(.|\n)*-----END PGP SIGNATURE-----

        The pipe character works as OR in EditPlus? I thought "([.\n]*)" was the way
        to go. Didn't test it, though.

        Christoph
      • John Morse
        Actually neither one works.... Any other ideas? thanks! John ... CP The pipe character works as OR in EditPlus? I thought ([. n]*) was the way CP to go.
        Message 3 of 6 , Apr 13 12:20 PM
          Actually neither one works....
          Any other ideas?
          thanks!

          John

          CP> Jens Vonderheide:
          >>
          >> Find what: -----BEGIN PGP SIGNATURE-----(.|\n)*-----END PGP SIGNATURE-----

          CP> The pipe character works as OR in EditPlus? I thought "([.\n]*)" was the way
          CP> to go. Didn't test it, though.

          CP> Christoph



          --
          John Morse pagemaker (at) semo (dot) net
        • J
          Can a PGP signature contain a dash? I don t know, but if it can t, then the following RE will work (and I have tested it). Using a dot makes it too greedy: it
          Message 4 of 6 , Apr 14 8:00 AM
            Can a PGP signature contain a dash? I don't know, but if it
            can't, then the following RE will work (and I have tested
            it). Using a dot makes it too greedy: it matches from the
            start of the first signature to the end of the last one.
            Using "not a dash" fixes that.


            -----BEGIN PGP SIGNATURE-----([^-]|\n)*-----END PGP
            SIGNATURE-----


            > Date: Sun, 13 Apr 2003 14:20:51 -0500
            > From: John Morse <pagemaker@...>
            > Subject: Re[2]: Reg Exp Question
            >
            > Actually neither one works....
            > Any other ideas?
            > thanks!
            >
            > John
            >
            > CP> Jens Vonderheide:
            > >>
            > >> Find what: -----BEGIN PGP
            > SIGNATURE-----(.|\n)*-----END PGP SIGNATURE-----
            >
            > CP> The pipe character works as OR in EditPlus? I thought
            > "([.\n]*)" was the way
            > CP> to go. Didn't test it, though.
            >
            > CP> Christoph
            >
            >
            >
            > --
            > John Morse pagemaker (at) semo (dot) net


            __________________________________________________
            Yahoo! Plus
            For a better Internet experience
            http://www.yahoo.co.uk/btoffer
          • John Morse
            This works, thanks very much! -- John J Can a PGP signature contain a dash? I don t know, but if it J can t, then the following RE will work (and I have
            Message 5 of 6 , Apr 14 8:55 PM
              This works, thanks very much!

              --
              John

              J> Can a PGP signature contain a dash? I don't know, but if it
              J> can't, then the following RE will work (and I have tested
              J> it). Using a dot makes it too greedy: it matches from the
              J> start of the first signature to the end of the last one.
              J> Using "not a dash" fixes that.


              --
              John Morse pagemaker (at) semo (dot) net
            Your message has been successfully submitted and would be delivered to recipients shortly.