| Quote |
|---|
True Friend wrote:
but i want replace domain.tld to domain_tld
|
The Bat! provides the macro to automatically find all occurrences of the pattern defined as the regular ex * pression ("
regexp") and replace it with the specified "
new_text" in the "
text" searched. A fourth argument
n, which is the number of the matched subpattern, may be optionally supplied. As the "
text" to be searched, the result of another macro can be used (for example,% OText). The syntax of this macro is following:
| Code |
|---|
%ReplaceRegExp("regexp", "new_text", "text"[, n]) |
So, your problem can be solved using the macro:
| Code |
|---|
%ReplaceRegExp("(?is)domain.tld", "domain_tld", "%OFromAddr") |
Given macro returns the sender address with modified domain name. I use %OFromAddr macro here instead of %FromAddr because you want probably analyse incoming mail.