Hi folks.
I am a total beginner at regex.
I want to specify a variable in my exim config, and I want the variable to contain a domain if $header_from contains that domain from a choice of good domains.
So I could do
so if the from address in an email is name@domain1.com then myvariable would contain name@domain1.com
I have been messing with some regex web sites and found that
would return "domain1" if the input contains "domain1" and "domain2" if the input contains "domain2".
How do I write the complete regex
?
I would like the "myvariable" to contain either "domain1", "domain2", or nothing.
Basically I don't know how to feed one thing through another in an expression.
I know that there are corner cases like if someone has an email address domain1something@domain2 but I can live with that.
I am only using for my own email addresses so I can just make sure that doesn't happen.
thanks, DNJ
I am a total beginner at regex.
I want to specify a variable in my exim config, and I want the variable to contain a domain if $header_from contains that domain from a choice of good domains.
So I could do
Code:
myvariable = $header_from
I have been messing with some regex web sites and found that
Code:
/(domain1)|(domain2)
How do I write the complete regex
Code:
myvariable = $header_from filtered by (domain1)|(domain2)
I would like the "myvariable" to contain either "domain1", "domain2", or nothing.
Basically I don't know how to feed one thing through another in an expression.
I know that there are corner cases like if someone has an email address domain1something@domain2 but I can live with that.
I am only using for my own email addresses so I can just make sure that doesn't happen.
thanks, DNJ