[xyzzy:00293] Re: text-newline-midashi-a
- Subject: [xyzzy:00293] Re: text-newline-midashi-a
- From: Masahito Henmi <henmi@xxxxxxxxxxxxx>
- X-mailer: Denshin 8 Go V321.2b5
> \(漢字)\*\(英数\)\|\(英数\)*\(漢字\)
> ^
> これってor??
> v v v v
> 1 2 3 4
> "\\1\\3 \\2\\4" <---なんでこうなるの ????
あっ、なんとなくわかった。
漢字→英字、英字→漢字の変わる境目を見つけて空白つきで
置換しているんですね。
例1) 漢字abcd
\(漢字)\*\(英数\)\|\(英数\)*\(漢字\)
左にマッチするので、
\1 = "漢字"
\2 = "abcd"
\3 = ""
\4 = ""
だから "\\1\\3 \\2\\4" --> 漢字 abcd
例2) abcd漢字
\(漢字)\*\(英数\)\|\(英数\)*\(漢字\)
右にマッチするので、
\1 = ""
\2 = ""
\3 = "abcd"
\4 = "漢字"
だから "\\1\\3 \\2\\4" --> abcd 漢字
------------------------------------------------------------
逸見雅人 Email henmi@xxxxxxxxxxxxx
Masahito Henmi