使用preg_match也接受@

Having a tough time.. this should be easy for you NINJA's out there.

Here is part of my function:

  if (strlen($_POST['uname']) < 3 || strlen($_POST['uname']) > 30 || !preg_match("/^([0-9A-Za-z])+$/i", $_POST['uname']) || $uname != 2)

We would want to include email address too, but can't figure out how to include the "@" symbol too ??

THanks in advance!!

If I understad what you want : !preg_match("/^([\W])+$/i" or maybe use posix :

<?php
$regex = '[[:punct:]]';

if (preg_match('/'.$regex.'/', 'somepas$', $matches)) {
    print_r($matches);
}
?>