On Wed 11-Jun-03 7:54am-0400, dajabo wrote:

> The REGEX-BASED Macro collection
> <http://www.silverstones.com/thebat/macros.html>
>
> offers the following string:
>
>        %quotes='%SETPATTREGEXP="(?is)((\s*)?\n?-----BEGIN PGP %-
>        SIGNED.*?\n(Hash:.*?\n)?\s*)?(.*?)(^(%-
>        -*?\s*?--\s*\n|%-
>        _{40,}\s*\n|%-
>        \n-----BEGIN PGP SIGNATURE.*s?\n|%-
>        -+\s+.*roups.*~--\>)|%-
>        \n+Get your FREE download|%-
>        \z)"%REGEXPBLINDMATCH="%text"%SUBPATT="4"'

> How does this work?

A simply reformatting and using PCRE Extended, produces:

----8<----------------------------------
%quotes='%SETPATTREGEXP="(?isx)
(                                         # Skip any PGP Signed stuff
  (\s*)?\n?
  -----BEGIN\sPGP\sSIGNED.*?\n
  (
    Hash:.*?\n
  )?\s*
)?
(.*?)                                     # Here is the capture
(^
  (                                       # Up to one of these
    -*?\s*?--\s*\n
    |
    _{40,}\s*\n
    |
    \n-----BEGIN\sPGP\sSIGNATURE.*s?\n
    |
    -+\s+.*roups.*~--\>
  )
  |                                       # or this
  \n+Get\syour\sFREE\sdownload
  |                                       # or none of the above
  \z
)"%REGEXPBLINDMATCH="%text"%SUBPATT="4"'
----8<----------------------------------

Which line or construct do you need help with?

-- 
Best regards,
Bill

"It is necessary to distinguish between
 the virtue and the vice of obedience."
  [Lemuel K. Washburn, _Is The Bible Worth
   Reading And Other Essays_, 1911]


________________________________________________
Current version is 1.62r | "Using TBUDL" information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to