/^-?(\d{1,3}(?:\.\d{1,5})?)$/ #### use Regexp::Common; /^$RE{num}{decimal}{-places=>'0,5'}$/ and $_ <= 180;