#!/usr/bin/perl $/ = ""; #paragraph mode. $* = 1; # enable multi-line patterns # Illustrating matching as much versus as little as possible. # Note the round brackets, identifying a component of the regexp, here ($1). while(<>) { $_ =~ s/\n/ /g; # replaces newlines with blanks /.*{(.*)}/; # print # /.*?{(.*)}/; # print # /.*{(.*?)}/; # print # /.*?{(.*?)}/; # print print $1, "\n" }