in reply to Perl pattern matching question
#!/usr/bin/perl use strict; use warnings; my @strings = ('A dog ate an apple', 'A apple ate a dog', 'A apple ate a oak', ); for my $string (@strings) { $string =~ s/\b([Aa])(\s+[aeiou])/$1n$2/g; print "$string\n"; }
What would you use before the following words, though?
heir user XML yak ylem
You need pronunciation, not spelling. Update: check Text::Phonetic and related modules for that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl pattern matching question
by AnomalousMonk (Archbishop) on May 06, 2015 at 18:05 UTC |