#!/usr/bin/perl use strict; use warnings; my $tests = '% only 1 profile is allowed '; my $regex = '\S'; if($tests !~ qr{$regex}ms) { print "$tests\n REGEX MATCHED\n"; } else { print "$tests\n FAILED!\n"; }