Java Spam Filter
<p>I'm trying to create a spam filter in Java using the Bayesian algorithm.</p>

<p>I use a text file that contains email messages and split the tokens using regex, storing these values into a hashmap.</p>

<p>My problem is, with regex, the email addresses are split so instead of:
johnsmith@example.com</p>

<p>regex causes the token to be:
john
smith
example</p>

<p>The same holds true for ip addresses, so for example, instead of:
192.55.34.322</p>

<p>regex splits the tokens to be:
192
55
34
322</p>

<p>So does anybody know of a way that I could read the email messages and store their contents as is? </p>

<p>AMENDMENT: I am using a regex that does not keep ip addresses or email addresses. It splits these up.</p>

<p>I was wondering if regex was not the way to go and if I could be suggested any alternatives for me to be able to filter emails to pick out characteristics I desire.</p>
