On 10/27/2000 at 2:34 PM, Christian Dysthe wrote:
CD> How can I make both first names show up in the automated greeting?
How about:
%SETPATTREGEXP="^.*(?=[^\S\n])|^.*"
...
Hello, %REGEXPMATCH="%TONAME"
...
That'll match everything up to the last space (but not newline) (i.e.
"George" and "George Mealer" both come out "George", but "George
Edward Mealer" comes out "George Edward". The only potential problem
is if you get "George Edward Mealer Junior", which comes out "George
Edward Mealer".
If you want a version that only handles the first two names,
the following should work:
%SETPATTREGEXP="^\S*(?:[^\S\n$]+\S*(?=[^\S\n$]))?"
That way, you get "George", "George", "George Edward", and "George
Edward", respectively.
Disclaimer: I'm a pretty lousy regexp programmer, and these prolly
aren't the most efficient ways to do it. However, it was a fun
exercise. :)
BTW, on a tangent to listers, is a regexp *supposed* to return the
contents of the first capturing subexpression? In my testing,
"G(e.r)ge" run against "George" returns "eor". I thought it would
return "George", but it turns out you have to make it noncapturing
("G(?:e.r)ge") to do that. If this is working as designed, someone
should update the Basic Expression Help section of the helpfile to
reflect that behavior, since they use an example quite similar to mine
with incorrect results listed.
Geo
--
George Mealer
[EMAIL PROTECTED]
"I attended the 1997 Animal Rights Barbecue" -- Anon.
--
--------------------------------------------------------------
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]