I'm trying to do what should be a simple job, but The Bat macro processing doesn't seem to be working as I'd expect. It's probably my understanding of the rather convoluted syntax of the macro language.
I've set up a regex to extract some text from the To: list. This includes a pair of brackets to produce a subpattern, But although the match succeeds, the subpattern is always null.
The macro code is:
The output is :
Even if I put '0' instead of '1' for the SUBPATT argument I still get nothing, so I can only assume that either I'm using the wrong syntax for the call to %SUBPATT or the sub patterns aren't being set. I've tested this on a regex tester and the subpattern is picked up OK.
Anyone got any ideas how to mend this?
Thanks in advance
Peter
I've set up a regex to extract some text from the To: list. This includes a pair of brackets to produce a subpattern, But although the match succeeds, the subpattern is always null.
The macro code is:
Code |
---|
%SETPATTREGEXP="(?i)\s*([^,]*@xxxx\.com[^,]*)[,$]?"%- Match is :%REGEXPMATCH="%OTOLIST": end of match%- %_Patt='%SUBPATT="1"'%- Subpattern is :%_Patt: |
Code |
---|
Match is :XXXX XXXX <XXXX@xxxx.com>: end of match Subpattern is :: |
Anyone got any ideas how to mend this?
Thanks in advance
Peter
Peter