<html><head><title>Re: regex to block emails while having word bounce before @ sign.</title>
</head>
<body>
<br><br>
<table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'courier new'; font-size: 9pt;">I think below regex matches everything up to <b>@ sign.<br>
<br>
/(bounce.*@)/i<br>
<br>
</b>it does NOT check anything<b> after @ sign. This is WHAT I NEED<br>
<br>
</b>something like these. <br>
<br>
noreply@<b>bounce</b>.</span><a style=" font-family:'courier new'; font-size: 9pt;" href="http://domain.com">domain.com</a><br>
<span style=" font-family:'courier new'; font-size: 9pt;">noreply@<b>bounce</b>.com<br>
</td>
</tr>
</table>
<br><br>
<span style=" font-family:'Courier New'; font-size: 9pt;">Be exceptionally careful of ".*" [It very, *very* often matches more things than you expected it to.]<br>
<br>
I can't think of a specific example of a line that would cause an issue, but your regex, will match something like this too. [Essentially anything with "bounce" with anything in-between, followed by an "@" later in the same line.<br>
<br>
blah blah blah </span><a style=" font-family:'Courier New'; font-size: 9pt;" href="jimbo@bounce.com">jimbo@bounce.com</a> <a style=" font-family:'Courier New'; font-size: 9pt;" href="freddy@someotherdomain.com">freddy@someotherdomain.com</a><span style=" font-family:'Courier New'; font-size: 9pt;"> blah blah blah @ blah [In this case, it will match on the second "@", not the first - as an example of how .* works.]<br>
<br>
or<br>
<br>
blah blah blah </span><a style=" font-family:'Courier New'; font-size: 9pt;" href="jimbo@somedomain.com">jimbo@somedomain.com</a> <a style=" font-family:'Courier New'; font-size: 9pt;" href="freddy-bounce@someotherdomain.com">freddy-bounce@someotherdomain.com</a><span style=" font-family:'Courier New'; font-size: 9pt;"> blah blah blah<br>
<br>
or<br>
<br>
blah blah blah </span><a style=" font-family:'Courier New'; font-size: 9pt;" href="jimbo@somedomain.com">jimbo@somedomain.com</a> <a style=" font-family:'Courier New'; font-size: 9pt;" href="freddy@someotherdomain.com">freddy@someotherdomain.com</a><span style=" font-family:'Courier New'; font-size: 9pt;"> bounce blah blah blah @ blah<br>
<br>
Any new regex, I'd monitor it carefully for some time to be sure it does what you expected it to do, especially if it has a .* in it.<br>
<br>
-Greg<br>
</body></html>