Newbie needs help with ereg regular expression

Hi,

I have to repost this to restate the question. No disrespect to the original
reply.

Please can someone help regarding providing a regular expression for entering
a set of characters with letters, numbers, periods (.), hyphens (-), or
underscores (_) only.

I need to do this using ereg

I've got as far as this but it doesn't quite work:

$pattern="^([a-z0-9.-_]{0,30})$";
if(ereg($pattern,$_SESSION['id']))
....


Thank you in advance.

Kind regards,

Raj (newbie)
raj [ Fr, 16 Februar 2007 12:55 ] [ ID #1631525 ]
PHP » alt.php.sql » Newbie needs help with ereg regular expression

Vorheriges Thema: renumbering fields
Nächstes Thema: Newbie needs help with regular expression