#!/usr/bin/perl -w use strict; my $string = "The quick brown fox jumps over the lazy dog"; $string =~ /(the .*? dog)/i; print "Match: '", $1, "'"; #### Match: 'The quick brown fox jumps over the lazy dog' #### Match: 'the lazy dog'
## Match: 'The quick brown fox jumps over the lazy dog' ##
## Match: 'the lazy dog'