perlquestion
nysus
<p>I'm going through the <a href="https://perldoc.perl.org/perlretut.html">perl regex</a> tutorial meticulously to try to start filling in the gaps in my regex knowledge and I came across this little nugget:
<c>"don't" =~ / .+? \b{wb} /x; # matches the whole string</c>
<p>I know what the "x" modifier does. But I have no earthly idea what <c>\b{wb}</c> 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 <a href="https://perldoc.perl.org/perlrebackslash.html#%5cb%7bwb%7d">found this.</a>
<p>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?
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-66801">
<font size=2><p>
$PM = "Perl Monk's";<br>
$MCF = "Most Clueless <strike>Friar</strike> <strike>Abbot</strike> <strike>Bishop</strike> <strike>Pontiff</strike> <strike>Deacon</strike> <strike>Curate</strike> <strike>Priest</strike> Vicar";<br>
$nysus = $PM . ' ' . $MCF;<br>
<a href="http://perlmonks.org/index.pl?node=Offering%20Plate">Click here if you love Perl Monks</a><br></font>
</div></div>