$str = '1welcometo india';; $str =~ m/([0-9]+)(?=welcome)welcometo india/ and print 'matched';; matched