From: "K.Kosako" Date: 2003-03-17T19:53:46+09:00 Subject: [ruby-dev:19829] Re: [Oniguruma] Version 1.8.4 Tanaka Akiraさんの<871y1678ok.fsf@serein.a02.aist.go.jp>から > Java の class set operation が欲しいという要望もあったりしますが、ちょっ > と大きめかな。 > > http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html > > Character classes > [abc] a, b, or c (simple class) > [^abc] Any character except a, b, or c (negation) > [a-zA-Z] a through z or A through Z, inclusive (range) > [a-d[m-p]] a through d, or m through p: [a-dm-p] (union) > [a-z&&[def]] d, e, or f (intersection) > [a-z&&[^bc]] a through z, except for b and c: [ad-z] (subtraction) > [a-z&&[^m-p]] a through z, and not m through p: [a-lq-z](subtraction) > > && で引き算ができるのがみそで、printable ASCII の範囲内で a-z を除く、 > などと書きたい時に a の前の文字と z の後の文字を調べなくても済むわけで > すが。 POSIX bracket[:xxx:]と衝突しているのが問題のような気がします。 ('[:'はPOSIX bracket専用にする?) それから、文字としての'['とどう区別するのかルールが不明。(エスケープする?) [[[abc]] -- 小迫@ソフネック 渋谷区恵比寿1-15-1