On Thu, May 17, 2001 at 09:25:53PM -0000, Stout, Joel R wrote:
> 
> I want to get the file names of all "EDI" files from a certain directory.  I
> do not want "ENT" (or encrypted) file names.  
> 
> Example:
> 
> The directory contains:
> a001.edi
> a002.edi
> a003.edi.ent
> a004.EDI
> 
> After getting the file name in $_ I did the following match:
> 
> if (/edi\b/i) { # thinking I would match file names 1, 2, and 4.  Instead I
> matched on all.  Wasn't \b supposed to help me out here?  Or does Perl
> consider "." in this case a word boundary?  Any help much appreciated.

\b matches any transition from \w to \W or vice versa.  \w is any
alphanumeric character plus "_", usually something like [A-Za-z0-9_],
and \W is its complement.  How about using pattern "/edi$/" ?

-- 
The cost of software has always been development cost, not replication
cost.  Sharing that cost among even a few users radically cuts the
per-user cost.
      -- F. Brooks fails to predict IP disputes in _No Silver Bullet_

Reply via email to