in reply to Regular expression questions

If I understood your question, this ll finish your job. But I think this is not efficient way, this can be still done with simple logic.

use strict; use warnings; while (<DATA>) { chomp; my $dic = $_; my (@arr) = $dic =~ /([abort])/g; #get the matching letters + my %unique; my $str = join "", grep (!$unique{$_}++, @arr); #make the gr +epped letters unique print $dic, "\n" if ($str eq 'abort'); #print if the order is + a, b, o, r, t }; prints: ------- abort abortion __DATA__ abroad abort abortion boat boaring boart

As imp said, when i tested your code it works fine for me as well.

Prasad

Replies are listed 'Best First'.
Re^2: Regular expression questions
by chinamox (Scribe) on Oct 07, 2006 at 14:43 UTC
    Thanks, this makes great sense. I will try it ASAP.