in reply to Re: Conditional regex
in thread Conditional regex
#!/usr/local/bin/perl -w use strict; my @words = qw/ beriberi coco couscous deed toot toto tutu assa ssaa /; for (@words) { print "$_\n" if /^(\w+)\1$/ || /^(\w+)(\w+)\2\1$/; }
beriberi coco couscous deed toot toto tutu assa
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Conditional regex
by Abigail-II (Bishop) on Jan 12, 2004 at 13:04 UTC |