Article View: news.software.readers
Article #234826Re: The Regular Expressions in turbo-plonk.sl
From: Troy Piggins
Date: Wed, 29 Jul 2009 19:56
Date: Wed, 29 Jul 2009 19:56
30 lines
2779 bytes
2779 bytes
* _@Jeff_Relf.Seattle.inValid wrote :
> This is simple:
> “ variable hdr = "extract_article_header(\"From\")";
> [...]
> variable expression = "(string_match("+hdr+
> ",\"[^ ]+ +[^ ]+ +<.+@.+>\",1) == 0) and (string_match("+hdr+
> ",\"peter\\.bergt\",1) == 0) and (string_match("+hdr+
> ",\".+@.+ +([^ ]+ [^ ]+.+)\", 1) == 0)";
> do { if (eval(expression)) [...] ”.
> www.wannabeHacker.COM/src/turbo-plonk.sl
>
> “hdr” contains the “From:” line; it's just text, a string.
> “expression” contains:
> “ string_match( hdr, "[^ ]+ +[^ ]+ +<.+@.+>" , 1 ) == 0 and
> string_match( hdr, "peter\.bergt" , 1 ) == 0 and
> string_match( hdr, ".+@.+ +([^ ]+ [^ ]+.+)", 1 ) == 0
>
> For “ From: Nicholas <Lawrence_Glickman@comcast.net> ”,
> the Regular Expression "[^ ]+ +[^ ]+ +<.+@.+>" matchs:
>
> blackSpace (“From:”), whiteSpace, blackSpace (“Nicholas” ) and
> “<Lawrence_Glickman@comcast.net>”.
>
> ".+@.+ +([^ ]+ [^ ]+.+)" matchs:
> “ From: Lawrence_Glickman@comcast.net (Nicholas) ”.
Thanks Jeff, for this and your other followup.
--
Troy Piggins
Technical Details
Message-ID:
<20090730055601@usenet.piggo.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!not-for-mailReferences:
<slrnh6sm2b.be4.ShadowTek@desktop.localdomain> <20090729080451@usenet.piggo.com> <slrnh6v215.m8d.ShadowTek@desktop.localdomain> <20090729101510@usenet.piggo.com> <slrnh6vnoo.8ce.ShadowTek@desktop.localdomain> <20090729175840@usenet.piggo.com> <_@Jeff_Relf.Seattle.2009_Jul29.6.16am.7d>Show Full Headers
Complete Article Headers
Message-ID: <20090730055601@usenet.piggo.com> Subject: Re: The Regular Expressions in turbo-plonk.sl Date: Thu, 30 Jul 2009 05:56:58 +1000 From: Troy Piggins <usenet-0907@piggo.com> References: <slrnh6sm2b.be4.ShadowTek@desktop.localdomain> <20090729080451@usenet.piggo.com> <slrnh6v215.m8d.ShadowTek@desktop.localdomain> <20090729101510@usenet.piggo.com> <slrnh6vnoo.8ce.ShadowTek@desktop.localdomain> <20090729175840@usenet.piggo.com> <_@Jeff_Relf.Seattle.2009_Jul29.6.16am.7d> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!not-for-mail Newsgroups: news.software.readers Organization: A noiseless patient Spider Lines: 30 Reply-To: usenet-0907@piggo.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.eternal-september.org U2FsdGVkX1/12vSC95lplulJhIhtiZiNTHaF19sdD1KUBE4a/0fNwNYLBqLS4rGs9Q9aOUqZfQROqXZx4LG8bi0e2CcrTvWOSqCSGnENUqDYgTeImTHsSEw2nkJYFIwTpgqLbamFhvs= X-Complaints-To: abuse@eternal-september.org NNTP-Posting-Date: Wed, 29 Jul 2009 20:14:09 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/BSCFoCQY5j8zoXF0RL7mLfTKuC+FDGfC41Gjj/WqRlw== X-NNTP-Proxy: Leafnode-2 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/) Cancel-Lock: sha1:hByqhT37owAln42PY2AXDuZmaVI= User-Agent: slrn/pre1.0.0-11/rt (Linux)