bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to match regex in bash? (any character)


From: Chet Ramey
Subject: Re: How to match regex in bash? (any character)
Date: Thu, 29 Sep 2011 14:29:39 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2

On 9/29/11 1:46 PM, Greg Wooledge wrote:

>            An additional binary operator, =~, is available, with the same
>            precedence as == and !=.  When it is used, the string to the
>            right of the operator is considered an extended regular
>            expression and matched accordingly (as in regex(3)). The return
>            value is 0 if the string matches the pattern, and 1 otherwise.
>            If the regular expression is syntactically incorrect, the
>            conditional expression's return value is 2.  If the shell option
>            nocasematch is enabled, the match is performed without regard to
>            the case of alphabetic characters.  Any part of the pattern may
>            be quoted to force it to be matched as a string.
> 
> The last sentence in the quote above.

I've changed that line in the current version of the manual page.  It
now reads:

`Any part of the pattern may be quoted to force the quoted portion
to be matched as a string.'

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]