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