http://www.perlmonks.org?node_id=23977


in reply to Re: Pig Latin
in thread Pig Latin

Adding qu| at the front of $1 and removing q from [...] provides support for the "qu" combination.   My first attempted tweak was to add (qu) inside $1's [...] but that hosed things for words like "jumped".

Bonus points for guessing the cliche phrase I tested this with.  <grin>

#!/usr/bin/perl -w use strict; while(<>) { s{ \b(qu|[bcdfghjklmpnrstvwxyz]*)([aeiou]+)(\w*) } { if($1) {$2.$3.$1.'ay'} else {$2.$3."way"} }egix; print; } # END
    cheers,
    ybiC