[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed: Case-insensitive matching does not work
From: |
Francesco Potorti` |
Subject: |
Re: sed: Case-insensitive matching does not work |
Date: |
Thu, 10 Oct 2002 17:13:42 +0200 |
> /foo/Id deletes lines containning the regex, case insensitive;
> s/foo/bar/I replacement---``foo'' is interpreted case insensitive;
>
> /xxx/Is/foo/bar/ replacement which is performed on each line matching
> the /xxx/ interpreted case insesitively; the /foo/
> is interpreted case sensitively.
>
> /xxx/s/foo/bar/I replacement is performed on lines matching /xxx/ (case
> sensitive), the replacement itself is case insensitive.
Hmmm. Okay. I had missed this point. Thank you.
> These two bits of information are independent, even when you use the
> shortcut
> /foo/s//bar/
I think this is correct and consistent. Only it should be stressed in
the manual, while as far as I know it is not even mentioned.
> s/href=raw/href=pot/I
>
> I consider the last form as the most readable one.
> Is there any special reason why it cannot be used?
No, in fact it can be written this way. I tend to begin all my sed
instructions with a regexp qualifier, and I find that more readable, but
then I have just learnt about the case-insensitive matching capabilities
of GNU sed, so I may need to review my habits.
Thanks again.
I think the bug should be downgraded to a wishlist asking for
documentation about this issue.