$interest !~ / # match against $interest (negated) ^ # start of line -? # optional minus sign \.? # optional decimal point \d+ # 1 or more digits (?: # start non-capturing group (i.e. not $1) \. # decimal point \d+ # 1 or more digits )? # end of group -- match 0 or 1 times $ # end of line /x; # end of regex (the /x modifier allows # comments in the regex -- can be useful)