[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to match pattern in bash?
From: |
Greg Wooledge |
Subject: |
Re: How to match pattern in bash? |
Date: |
Wed, 23 Feb 2011 08:25:47 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Feb 22, 2011 at 08:03:39PM -0800, Micah Cowan wrote:
> Bash's special builtin [[ ]] syntax also provides both wildcards, and
> (much more powerful) extended regexes (roughly similar to Perl regexes;
> they're what egrep uses).
Just for the record, ERE (Extended Regular Expressions), as used by egrep
and by bash's [[ =~ operator, are not the same as PCRE (Perl-Compatible
Regular Expressions).
Neither bash, nor any POSIX-defined tool, provides PCRE. Some GNU tools
that have extensions to the POSIX standard might offer them (the only
one I know off hand is GNU grep's -P flag).