Re: [regex-tutorial]: Part 1

2002-05-17 Thread Ingrid Spitzer

Hello Ottar,

  Friday, 17.05.2002 you wrote to TBUDL:

GE>> (http://www.Dirk-Heiser.de/RegExTest/RegExTest_V0.3beta.zip)

> I am unable to get in touch with this server

Try this URL:

http://www.Dirk-Heiser.de/RegExTest/RegExTest.zip
  
No problem here. At the moment ;)

-- 
Ciao,
Ingrid
  
http://www.pro-privacy.de
PGP and The Bat!
Regular Expressions in The Bat!



Current Ver: 1.60k
FAQ: http://faq.thebat.dutaint.com 
Unsubscribe: mailto:[EMAIL PROTECTED]
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]
Bug Reports: https://bt.ritlabs.com



Re: [regex-tutorial]: Part 1

2002-05-16 Thread Ottar Grimstad

Hello Gerd,

Monday, May 13, 2002, 9:37:13 PM, you wrote to TBUDL:

GE> You have to download a DLL written by Dirk Heiser

GE> (http://www.Dirk-Heiser.de/RegExTest/RegExTest_V0.3beta.zip)

I am unable to get in touch with this server

-- 
Best regards,
  Ottar Grimstad, Norway
http://home.online.no/~ottgrims
Using The Bat! 1.60h on Windows 98 version 4,10



Current Ver: 1.60k
FAQ: http://faq.thebat.dutaint.com 
Unsubscribe: mailto:[EMAIL PROTECTED]
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]
Bug Reports: https://bt.ritlabs.com



Re: [regex-tutorial]: Part 1

2002-05-14 Thread Jan Rifkinson

Hello Gerd.

At 3:37 PM on Monday, May 13, 2002 you wrote the following
about [[regex-tutorial]: Part 1]:

Gerd> The tutorial is published on www.pro-privacy.de (look
Gerd> there for "special") and on Marck's official FAQ at
Gerd> http://www.silverstones.com/thebat/FAQ.html

  Thanks for your efforts. I will be reading the tutorial w
  great interest.

-- 
Jan Rifkinson
Ridgefield, CT USA
TB! V1.60c/W2K_SP2
ICQ 41116329



Current Ver: 1.60k
FAQ: http://faq.thebat.dutaint.com 
Unsubscribe: mailto:[EMAIL PROTECTED]
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]
Bug Reports: https://bt.ritlabs.com



[regex-tutorial]: Part 1

2002-05-13 Thread Gerd Ewald

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bats(wo)men,

some days ago Daniel Grunberg asked for an English version of a
tutorial on regular expressions (TBTECH,
) which I published on
www.pro-privacy.de for the German beginners list.

First thing I did was a mail to Marck to find out whether there is
some interest in a translation.

Well, here it is. At least the first part. Marck checked the text and
transformed it into something you can read. Thank you, Marck! (My
translation was something between the following text and a translation
altavista did, hehe).

The whole tutorial will be subdivided in five parts. It will take some
time to prepare the next part, so you have to wait one or two weeks
for the next part to be published. Sorry! Anyway, we decided to
publish it in parts, so you can start learning regexian and you have a
chance to ask questions for better understanding.

Any part is posted to TBUDL using a special subject ("[regex
tutorial]") so that those of you who don't want to read it may define
a filter to kill the mail. Please use the same prefix in your subject
for any reply.

The tutorial is published on www.pro-privacy.de (look there for
"special") and on Marck's official FAQ at
http://www.silverstones.com/thebat/FAQ.html


Ok, that's it. Let's start. I hope you will enjoy the tutorial :-)


START OF PART 1 ==

1. Introduction

Whenever I came across something interesting in a mail that was
created with TheBat! like "cleaned" Subject-strings or automagically
deleted PGP-lines, I would ask in one of the mailing lists: "How did
you do that?". Quite often I would receive a reply like "You will need
a regex for that!" And sometimes the result was something like:

%QUOTES="%SETPATTREGEXP=""(?is)(-BEGIN PGP
SIGNED.*?\n(Hash:.*?\n)?\s*)?(.*?)(^(- --|--\n|-BEGIN PGP
SIGNATURE)|\z)""%REGEXPBLINDMATCH=""%text""%SUBPATT=""3"""

This is only a simple example of those cryptic looking combinations of
TB!-Macros and regular expressions which are simply called "regex" by
the TB-experts. To me it seemed a random sequence of characters; as if
a cat walked across my keyboard. Awkward, arbitrary and cryptic, that
at least was my impression until Januk Aggarwal (special thanks to
him) gave me a short introduction to regex at TBTECH and my workmate
Alfred Rübartsch gave me a copy of Jeffrey Friedls excellent book
"Mastering Regular Expressions".

Although I entered the fascinating world of Regular Expression with
the help of these two, I am still not an expert in the "regexian"
language. Anyway, as an advanced beginner, I have dared to write this
tutorial to hopefully explain some things and give a good start in
"Regular Expressions" to other beginners.

This tutorial is meant to bring you into closer contact with the regex
topic. Well, let's see how it works; let's see whether we will be able
to explain the "regex"-example above by the time we come to the end of
this tutorial.


2. Regular Expressions

2.1. What does "Regular Expression" mean?

Regex are not only used in TB! You can find them in quite a lot of
different UNIX-tools (e.g. grep), in some programming languages like
PERL (Practical Extraction and Report Language, sometimes called
'Pathologically Eclectic Rubbish Lister' ) and even my editor
UltraEdit uses them.

Laura Lemay wrote in her book "PERL in 21 days" that the term "Regular
Expression" makes no sense at first sight (to be honest: even at
second sight it still makes no sense to me), because these are not
real expressions and furthermore no one really can explain why they
are "regular"! Well, let's ignore this; let's simply accept that the
term "Regular Expression" has its origin in formal algebra and that
they are indeed part of Mathematics.

The easiest and most convenient way to define "Regular Expression" is
to say: "They are search patterns to match characters in strings."

Those of you who have tried to find files using the DOS command line
or the search function in the Explorer may have used patterns like:

dir *.doc
copy *.??t c:\temp

These examples show patterns that consist of letters, stars, question
marks and other characters to define which files should be listed or
copied. In the first example only files that have the suffix "doc"
should be listed. In the second example only files that have a
three-letter suffix and a "t" as last character in the suffix should
be copied.

But these regex are merely wildcards! In no way as mighty as "Regular
Expressions". One can't compare them to real regex, which offer much
more than wildcards for characters.


3. Simple Patterns

To explain some regular expressions and to understand the examples
given in this tutorial we have to define how the regex will appear. I
will envelope the regular expression in quotation marks ("). If you
want to test the regex you will have to copy the part between the
"-characters. Testing regular expressions? Yes, sure, this is
possible.

You have to downlo