in reply to Perl Golf (was RE: (Ovid) RE: Pig Latin)
in thread Pig Latin
The reason I am using three backreferences is because the data saved to $2 is tricky. Your equivalent (ignoring the "qu" problem) is [^\W0-9_]. This allows you to match all alphabeticals but does no discrimination for vowels. However, you apeared to notice this when you mentioned [b-df-hj-np-tv-z]. Therefore, I suspect that you intended the following and (assuming you did intend this) I offer you kudos for a clever regex:
I also noticed that, in this case, using the /i modifier ignored vroom's "lowercase" spec, but does result in a shorter regex.s/\b(qu|[^\W0-9_aeiou]+)?([a-z]+)/$1?"$2$1ay":"$2way"/ieg;
Cheers,
Ovid
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: (Ovid) RE: Perl Golf
by japhy (Canon) on Jul 24, 2000 at 00:00 UTC | |
by ybiC (Prior) on Jul 24, 2000 at 02:38 UTC | |
by japhy (Canon) on Jul 24, 2000 at 02:54 UTC | |
by Ovid (Cardinal) on Jul 24, 2000 at 03:10 UTC |