Re: a regexp question

2000-09-15 Thread Peter Steiner

On Fri, 15 Sep 2000 11:21:25 -0700, Jason Thompson wrote:

JT> You'll see that my signature looks like this:

JT> Jason Thompson mailto:[EMAIL PROTECTED]
JT> PGP Key ID: 0x3084BEC4 [The Bat! v1.46c]

JT> As you can see, the TB version has several spaces before it to make it
JT> appear "right justified". Since I keep up with the beta versions of
JT> TB, the %thebatversion string is frequently changing in length, so
JT> every time it changes I have to edit the number of spaces in my
JT> signature template.

JT> My question is, can TB do this work for me with a regexp?

I have found a way. Perhaps there are other more elegant ideas, but i
could not think of them...

%SETPATTREGEXP=" {5}\[.{13}\]| {4}\[.{14}\]| {3}\[.{15}\]"
%REGEXPMATCH="[The Bat! %THEBATVERSION]"
   spaces (enough of them!)

The key is that you combine several subpattern in the form
" {5}\[.{13}\]" (without quotes) for every possible length of your
version string. The first number is the number of digits it takes (5
in this example) when the string inside the brackets is 13 characters
long.

Make sure that in the REGEXPMATCH you put enough spaces for the
biggest variant (in my example '5').

My RE above is only a short example and works only for three different
lengths, but you should be able to expand it to any desired length.

HTH

Peter
-- 
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:
   
To Unsubscribe from TBUDL, double click here and send the message:
   
--

You are subscribed as : archive@jab.org





Re: a regexp question

2000-09-15 Thread Steve Lamb

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Friday, September 15, 2000, 11:21:25 AM, Jason wrote:
> My question is, can TB do this work for me with a regexp? The number

AFAIK, no.  Regexp is pattern matching and string replacement but does not
have such capabilities.

- --
 Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
 ICQ: 5107343  | main connection to the switchboard of souls.
- ---+-

-BEGIN PGP SIGNATURE-
Version: PGP 6.5i

iQA/AwUBOcJvvHpf7K2LbpnFEQJH0ACffOQIopnD2j+XUK7Knxqzg06MqbkAoLbj
k0sD+5A8AJHxyJ1SvccJSzp9
=KVMT
-END PGP SIGNATURE-

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

You are subscribed as : archive@jab.org





a regexp question

2000-09-15 Thread Jason Thompson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello everyone...

You'll see that my signature looks like this:

Jason Thompson mailto:[EMAIL PROTECTED]
PGP Key ID: 0x3084BEC4 [The Bat! v1.46c]

As you can see, the TB version has several spaces before it to make it
appear "right justified". Since I keep up with the beta versions of
TB, the %thebatversion string is frequently changing in length, so
every time it changes I have to edit the number of spaces in my
signature template.

My question is, can TB do this work for me with a regexp? The number
of spaces that must be inserted can be calculated with very simple
math:

18 - (length of %thebatversion string)

However, I understand very little of regexps at the moment... Can
anyone think of a way for me to work this out? TIA

- --
Jason Thompsonmailto:[EMAIL PROTECTED]
PGP Key ID: 0x3084BEC4[The Bat! v1.46c]
- ---
God is real, unless declared integer.

//The Bat! v1.46c
//Win98 v4.10 build 1998
//AMD K6-2 400mhz 128mb

-BEGIN PGP SIGNATURE-
Version: PGP 6.5.8

iQA/AwUBOcJora2yGRAwhL7EEQJDQgCeIUtvp1KcZBD08V8pzbkaeVeN7K8An3YA
nuPiN3vht6PXHCZo1D342+ly
=VEpP
-END PGP SIGNATURE-

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

You are subscribed as : archive@jab.org