if($doc =~ /foo\G/g) { print "position preceeded by foo!\n"; }