gnewsense-dev
[Top][All Lists]
Advanced

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

Re: [Gnewsense-dev] Re: [gNewSense-users] possible error in gen-kernel b


From: Bake Timmons
Subject: Re: [Gnewsense-dev] Re: [gNewSense-users] possible error in gen-kernel b
Date: Fri, 21 Aug 2009 13:06:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

"Greenacre, Evan R CIV NSWCDD, K54" <address@hidden> writes:

> Sorry, was just the perfectionist in me.  Most all this is really mute since 
> we still don't understand what the ? is for.  (i.e. you can ignore this 
> babbling geek)
>  
> To start, I aggree with holding off on the correction.
>  
> But to the regex itself,  the core of the expression is the grouping [^ ?] 
> (which will match anythingthing but blank or ?), but they wanted to make sure 
> there was at least 1
> character.  So originally that repeated it once and used the * on the second, 
> which is the regex modifier for 0 or more times. The plus sign is the regex 
> for 1 or more. So they
> end up being the same. However, long story short, not sure if it was needed 
> since they put that inside of beginning and end of line markers (the very 
> first carat ^, and the
> ending dollar $).
>  
> The complication comes when they have to be escaped.  The shell is grabbing 
> some of those characters and doing its own thing with them first.  For 
> instance, the parenthesis are
> being escaped to get them thru the shell and to the regex pattern.
> The plus sign must need that to. My only question is, why don't we need to 
> escape the asterick.  But there's more than one way to do it.

This is a question of basic versus extended regular expressions.  Basic
is the default in grep and sed.  From the grep manual, we see how the
plus (but not the asterisk) must be used:

   Basic vs Extended Regular Expressions
       In basic regular expressions the meta-characters ?, +, {, |,  (,  and  ) 
 lose
       their  special  meaning;  instead use the backslashed versions \?, \+, 
\{, \|,
       \(, and \).




reply via email to

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