Reputation: 1224
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!!
Upvotes: 0
Views: 29
Reputation: 132
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);
}
?>
Upvotes: 2