bug-bash
[Top][All Lists]
Advanced

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

Re: RFE: request for grouping mechanism to work in double brackets where


From: Pierre Gaston
Subject: Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal
Date: Fri, 24 Sep 2010 09:43:10 +0300

On Fri, Sep 24, 2010 at 1:08 AM, Linda Walsh <bash@tlinx.org> wrote:
>
>
> Pierre Gaston wrote:
>>
>> I though I showed you how your suggestion only solves part of the problem
>> in only one particular situation and in an inconsistent manner while
>> introducing
>> other problems but oh well
>
> ---
>        What are you referring to?  I thought I answered
> your questions.
>
> You questions:
>>
>> what about:
>>
>> [[ foo =~ bar && baz ]]
>>
>> Should bar && baz be considered as one regexp? if not, how would you
>> write a regexp matching
>> `foo && baz' ? or `foo && baz.*' ? if yes how would you do and and
>
> ---
>        My answer was that any expression that would currently have
> a legal interpretation would be interpreted the same as it is now.
> So you expression would be interpreted as it currently is.  However,
> if you wrote
>
> [[ foo =~ this bar && baz ]]  ==> then
>
> [[ foo =~ this ( bar & baz ) ]] --? legal under current rules?  => no.
> [[ foo =~ (this bar && baz ) ]] -- legal interpretation under current rules?

Are you even aware that ( ) have a meaning in the extended regular
expression syntax?

> Then you asked.
>>
>> What if you want to match `  bar && baz   ' with trailing or leading
>> spaces?
>> Should you be able to also use space without quotes in this case and have
>> [[ foo =~ bar ]] and [[ foo =~   bar   ]] have different meanings?
>
> ---
> I answered you -- didn't you see this?
>   "You'd be no worse off than you are now -- you'd have to use backslash
> or some other quoting mechanism."

Exactly, your suggestion only solve part of the problem, locally, so
why add another thing?
In the end of the day you'll still have to learn how quote works.

I won't answer anymore to this subject, apology to the others ...



reply via email to

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