http://qs321.pair.com?node_id=11121029

nysus has asked for the wisdom of the Perl Monks concerning the following question:

I'm going through the perl regex tutorial meticulously to try to start filling in the gaps in my regex knowledge and I came across this little nugget: "don't" =~ / .+? \b{wb} /x;  # matches the whole string

I know what the "x" modifier does. But I have no earthly idea what \b{wb} character is or how it works. The tutorial provides no explanation except to say something vague about using it to match apostrophes. So I did a little searching and found this.

But this still sheds no light for me on why throwing this in after ".+?" should cause it to match the whole string "don't". Doesn't ".+?" just match "d"? Why should \b{wb} suck up the rest of the string?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks