Bruce. さんは書きました (2008/09/17 2:48):
> Takeshi Oya さんは書きました (2008/09/17 1:55):
>
>> 応用して、…。だ、駄目だ。'['はどうしたらよいのでしょう?
>
> echo [TSfree:13] Re: 便利なメーラは?|mbsed -e "s/[^[]//g"
> [
>
> echo [TSfree:13] Re: 便利なメーラは?|mbsed -e "s/[^]\[]//g"
> []
>
> echo [TSfree:13] Re: 便利なメーラは?|mbsed -e "s/[^][]//g"
> mbsed: -e expression #1, char 10: unterminated `s' command
>
>
>
> Basic Regular Expressions
> http://www.opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003_005
>
> RE Bracket Expression
>
>
> The right-bracket (]) loses its special meaning and represents itself in a
> bracket expression if it occurs first in the list (after an initial circumflex
> (^), if any). Otherwise, it terminates the bracket expression, unless it appears
> in a collating symbol (such as [.].]) or is the ending right-bracket for a
> collating symbol, equivalence class or character class. The special characters:
>
> . * [ \
>
>
> (period, asterisk, left-bracket and backslash, respectively) lose their special
> meaning within a bracket expression.
>
>
>
> The hyphen character will be treated as itself if it occurs first (after an
> initial ^, if any) or last in the list, or as an ending range point in a range
> expression. As examples, the expressions [-ac] and [ac-] are equivalent and match
> any of the characters a, c or -; [^-ac] and [^ac-] are equivalent and match any
> characters except a, c or -;
>
nmbsed --ver
GNU sed version 4.1.4
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
Modified for Win32 Japanese by moonlight-mile@...
Build date is Apr 7 2007
echo [TSfree:13] Re: 便利なメーラは?|sed -e "s/[^][]//g"
sed: -e expression #1, char 10: unterminated `s' command
mbsed --ver
GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
Modified for Win32 Japanese by moonlight-mile@...
Build date is Sep 1 2008
echo [TSfree:13] Re: 便利なメーラは?|mbsed -e "s/[^][]//g"
[]
--
木村浩一
I thought what I'd do was, I'd pretend I was one of those deaf-mutes or should I?
mail kbk [at] kt.rim.or.jp
web www.kt.rim.or.jp/~kbk/zakkicho/
homepage3.nifty.com/farstar/