Basic regexp help

Posted by casben79 on Stack Overflow See other posts from Stack Overflow or by casben79
Published on 2010-04-28T12:12:07Z Indexed on 2010/04/28 12:33 UTC
Read the original article Hit count: 369

Filed under:
|
|

I am new to programming PHP and am trying to validate a field in a form.

The field if for a RAL color code and so would look something like : RAL 1001. so the letters RAL and then 4 numbers.

Can someone help me set them into a regular expression to validate them. i have tried this with no success:

$string_exp = "/^[RAL][0-9 .-]+$/i";

What can I say but sorry for being a complete NOOB at PHP.

Cheers Ben

© Stack Overflow or respective owner

Related posts about php

Related posts about regex