Java : Parsing a String & Checking for "@"
<p>How can i use Pattern.compile to check whether a string contains "@". Something like this->></p>

<pre><code>    Pattern pattern = Pattern.compile("^[\\w\\.-]*@[\\.\\w-]*$");
    Matcher matcher = pattern.matcher(string);
    return matcher.matches();
</code></pre>
