[Top][All Lists]

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

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

From: Roger
Subject: Re: How to match regex in bash? (any character)
Date: Wed, 28 Sep 2011 12:43:01 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

> On Tue, Sep 27, 2011 at 07:58:50PM -0500, Peng Yu wrote:
>On Tue, Sep 27, 2011 at 6:51 PM, Chet Ramey <address@hidden> wrote:
>> On 9/27/11 6:41 PM, Roger wrote:
>>> Correct.  After reading the entire Bash Manual page, I didn't see much 
>>> mention
>>> of documentation resources (of ERE) besides maybe something about egrep from
>>> Bash's Manual Page or elsewhere on the web.  After extensive research for
>>> regex/regexpr, only found Perl Manual Pages.
>>> Might be worth mentioning a link or good reference for this ERE within the 
>>> Bash
>>> Manual (Page)?
>> The bash man page refers to regex(3).  On my BSD (Mac OS X) system, that
>> refers to re_format(7), which documents the BRE and ERE regular expression
>> formats.  On an Ubuntu box, to choose a representative Linux example, that
>> refers to regex(7), which contains the same explanation, and the GNU regex
>> manual.  This sort of "chained" man page reference is common.
>> If you like info, `info regex' on a Linux box should display both pages.
>Since regex(7) is actually what should be referred on ubuntu, and
>there is indeed a manpage regex(3) on ubuntu, the difference on which
>regex man page should be specify in man bash. I was looking at
>regex(3) on my ubuntu, which doesn't have any relevant information.


Seems I used 'man regex' as well here.  AKA regex(3).  But I did
realize this a few weeks ago; the real regex description being 'man 7 regex'.
The Bash Manual Page denotes only regex(3).

>Also, adding a few more examples just cost a few extra lines, I don't
>think that the manpage should be so frugal in terms of adding examples
>to elucidate important concepts.


As to why I'm suggesting one or two examples for Bash Parameter
Expansion. ;-)  However, I think the best examples for Parameter Expansion
is code with a sample text next to the code of what text will look like
after it's passed through the code. ie. Greg's Wiki Bash FAQ - Parameter


reply via email to

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