Yes, you show no code, the problem description is very vague, you don't say with what the words are to be 'replaced', and yes, this does smell like homework, but...
c:\@Work\Perl\monks>perl -wMstrict -le "my $s = 'In the table above, the characters themselves, in the first +column, are links to descriptions of characters'; print qq{'$s'}; ;; my %xlate = qw(table tooble characters croobles selves others first second +links loonks); ;; my ($word) = map qr{ $_ }xms, join q{ | }, keys %xlate ; print $word; ;; $s =~ s{ ($word) }{$xlate{$1}}xmsg; print qq{'$s'}; " 'In the table above, the characters themselves, in the first column, a +re links to descriptions of characters' (?msx-i: first | selves | table | links | characters ) 'In the tooble above, the croobles themothers, in the second column, a +re loonks to descriptions of croobles'
Update: Caution: long lines: some wraparound may have occurred.
Give a man a fish: <%-(-(-(-<
In reply to Re: Regular Expressions
by AnomalousMonk
in thread Regular Expressions
by replytokp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |