Beefy Boxes and Bandwidth Generously Provided by pair Networks
Frank Just another Perl shrine  Regular expression for
hexadecimal number  by isha (Sexton) on Jul 30, 2007 at
12:46 UTC ( #629540=perlquestion: print w/ replies, xml ) Need
Help?? isha has asked for the wisdom of the Perl Monks
concerning the following question:  I want to check that the
value is between 0x0 and 0xffff or not. how can i do with
regular expression. Please tell the regular expression to check
the hexadecimal number..  Comment on Regular expression for
hexadecimal number Re: Regular expression for hexadecimal number
by FunkyMonk (Canon) on Jul 30, 2007 at 12:55 UTC     /^ # start
of string 0x # 0x prefix [0-9A-F] # a hex digit {1,4} # 1 to 4
of them $ # end of string /xi # x = allow spaces & comments in
regexp # i = ignore case      or just /^0x[0-9A-F]{1,4}$/i
update: slight rewording to keep ww happy;)  Re: Regular
expression for hexadecimal number by mickeyn (Priest) on Jul 30,
2007 at 12:58 UTC             {1,4}  #   betwee