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:
   <mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
   <mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------

You are subscribed as : [email protected]


Reply via email to