Afficher un message
Vieux 23/08/2006, 16h46   #6
Jon LaBadie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sed: How do you match a string containing square brackets ANDhyphens?

Dave S. wrote:
> Jon,
>
> No, the O'Reilly book didn't say anything about making a hyphen the
> last character to escape its meaning. I'll try that.
>
> But that still leaves the opening square bracket to be dealt with. What
> about it?
>
> Thank you.
>
>
> Jon LaBadie wrote:
>
>> If the backslash, '\' were an escape character inside brackets
>> it might work. But it is not and escape character in that context.
>>
>> The O'Reilly book also said, or should have said, a hyphen as the
>> first or the last character is treated as a member of the list.
>> So you could do []xyz-] to make a list matching 5 characters.

>


The opening bracket can be anywhere in the list.
  Réponse avec citation
 
Page generated in 0,05751 seconds with 9 queries