Forum Moderators: coopster

Message Too Old, No Replies

HTML Hexadecimal number

using regex to check a value is in hex format?

         

raingerpete

1:26 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



I am try to check if a 6 digit number is in hexadecimal?
e.g. FFFFFF

if (ereg ("\x[0-9A-Fa-f]{1,2}", $colour1))
{ echo "Continue......"; }
else { echo "Invalid format"; }

how do I change the regualar expression for 6 digits?

pete

tepes

4:41 pm on Apr 11, 2003 (gmt 0)



Try {6} instead of {1,2}.