Coba dengan cara ini,
function execRegex($text) {
$regex = "((?=.*\d)(?=.*[a-zA-Z]).{3,11})";
if (preg_match($regex, $text, $matches)) {
if (preg_match($regex, $matches[0])) {
return $text;
} else {
return false;
}
} else {
return false;
}
}
2010/11/9 Jesri HT PURBA <[email protected]>
>
>
> Para suhu php,
>
> tolong saya untuk memfilter (reg exp) input dari form :
> 1. min 3 char dan max 11 char
> 2. harus mengandung paling tidak 1 huruf (tidak boleh angka doang).
>
> Terima kasih,
>
> Salam,
>
> Jesri
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
------------------------------------
--
www.itcenter.or.id - Komunitas Teknologi Informasi Indonesia
Gabung, Keluar, Mode Kirim : [email protected]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ITCENTER/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ITCENTER/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/