#!/usr/bin/perl -w use strict; # 0 0 1 0 1 my @words = qw, eLBow ElBow elBoW eLbow elboW,; # I want to match all words elbow # whose W is capital, and e and o e are in lower case # and but l and B can be either case # There are two ways to do it for(@words) { printf "%s\n",$_ if /e(L|l)(B|b)oW/; } ##or using Extended Regular Expressions for(@words) { printf "%s\n",$_ if /e(?i-:lb)oW/; } __END__ # the output elBoW elboW elBoW elboW