in reply to Re: Regular Expression
in thread Regular Expression
use strict; use warnings; my @matches = (); open (DICT, "dictionary.txt") or die "Dictionary.txt: $!\n"; while (my $words = <DICT>) { chomp $words; push @matches, $words . " 1" if $words =~ /a$/; push @matches, $words . " 2" if $words =~ /.*[i].*[i].*[i].*[i].*[ +i].*/gi; push @matches, $words . " 3" if $words =~ /[^aeiou]/gi; my $reverse = reverse($words); push @matches, $words . " 4" if $words eq $reverse; } close (DICT); foreach (@matches) { print $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Regular Expression
by graff (Chancellor) on May 19, 2003 at 01:43 UTC | |
|
Re: Re: Re: Regular Expression
by hangmanto (Monk) on May 19, 2003 at 00:17 UTC |