On Thu, 10 Aug 2000 13:47:29 -0700, Steve Lamb wrote:

SL> Thursday, August 10, 2000, 12:32:00 PM, Peter wrote:
>> The PCRE part of the help file is IMHO one of most complete help
>> topics, once you've found it. My tip for locating it: open Help, go to
>> the find tab and enter "regular". Choose the entry "What are regular
>> expressions" and from there on you have all the links.

SL>    No, it is not.  It tells you to look at the PCRE docs [...]

Probably nitpicking, but my the_bat.hlp from 2000-05-26 (which ships
with TB 1.45) *includes* most of the PCRE doc and tells:

  "Regular expressions are also described in the Perl documentation
  and in a number of other books, some of which have copious examples.
  Jeffrey Friedl's "Mastering Regular Expressions", published by
  O'Reilly (ISBN 1-56592-257-3), covers them in great detail. The
  description here is intended as reference documentation."

SL> [...] which tells you what regular expressions are and how they
SL> work.

The PCRE doc part in the_bat.hlp indeed tells (in the help topic
"Regular Expressions Syntax (Basic)"): "A _regular expression_ is
a set of rules that describes a generalised string. [...]" and has
many general examples.

I agree that the PCRE doc included in the_bat.hlp is "intended as
reference" and not as a tutorial...

SL> It does not, as of the last time I checked, tell you how they are
SL> implemented in TB! or provide examples of how to use them in TB!.
SL> Without those all important implementation details knowing regex
SL> is useless.

My help file tells some details (the varying PCRE default options) for
the 4 areas where TB! allows RegExps:

- Message Editor
- Message Finder
- Sorting Office / Filters
- Templates

The Templates topic has one example how to use RegExps together with TB
macros.

And in the announcement of 1.46b2 Maxim told us which version of PCRE
is used:

MM> [*] Regular Expressions engine upgraded to PCRE v3.3

The documentation is (of course) not yet upgraded, but i hope the help
file for 1.46 will include the PCRE 3.3 docs...

SL>     Remember, XNews, TB!, Python and Exim are all programs I use (some more
SL> than others) that use PCRE.  Not a one implements them the same way or in the
SL> way, in fact, that Perl does even though they are "Perl Compatible Regular
SL> Expressions."

The differences to Perl (w.r.t. Perl 5.005) are clearly stated in the
help topic "Differences from Perl".

SL> For me I'd always use the case insensitive flag at the end, eg:
SL> /make money fast/i However, I'm not sure if TB! uses the / markers
SL> like Perl does and I'm not familiar with PCRE's internal way of
SL> doing it, either.

IMHO the / markers in Perl are not part of the RegExp itself, but just
using the usual matching operator notation. My old Camel Book
(Programming Perl 2nd Ed.) lists the following RegExp operators:

  m/PATTERN/gimosx
  /PATTERN/gimosx
  ?PATTERN?
  s/PATTERN/REPLACEMENT/egimosx

The PATTERN is just one part of an operator.
  
I would like to write /make money/i in TB too, but strictly speaking,
this is not Perl RegExp, but Perl RegExp matching operator (and I
would like to have the Perl subst operator in TB!!!)

Regards

Peter

BTW: the PCRE library is available at
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-- 
Peter Steiner <[EMAIL PROTECTED]>

-- 
--------------------------------------------------------------
View the TBUDL archive at http://tbudl.thebat.dutaint.com
To send a message to the list moderation team double click here:
   <mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
   <mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------

You are subscribed as : archive@jab.org


Reply via email to