Changed regex to work with older Perl versions