On Tue 30 March 2004, 2:54:02 +1000, Marck D Pearlstone wrote:
MDP>>> %IF:"%ABtoGender"="0":"Spett.le":"Egr." %-
MDP>>> %SETPATTREGEXP="(.*)( - .*)?"%-
MDP>>> %REGEXPBLINDMATCH="%ABTOLASTNAME='%TOLNAME'"%-
MDP>>> %SUBPATT(1)

JO>> Don't Know why the brackets in ( - .*)? are useless, but it's running
JO>> well.

> They are important if you have any records without either "- work"
> or "- home" at the end. Then the expression will fail to match
> completely and result in a blank name. My version is the one to use.

When I tried this on an entry with "smith - home" as the last name, the
first expression matched the entire last name and left a zero occurrence
of the second expression. I thought the way around this was to set the
first expression in the regex to be "(.*?)" (I think the term is
non-greedy), but that simply failed to match anything then.

Can anyone explain why that might be the case?

-- 
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1




________________________________________________
Current version is 2.04.7 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to