sent 09:17:23 17 June 2011, Friday
by Tony Mechelynck:
> Well, in Vim /[] constructs are limited to approximately 256 character
> values (or maybe 257)
1. 257 exactly.
2. Not collections themselves, but ranges within collections.
3. In current implementation collection with large number of characters should
be very slow.
4. You can always emulate it with `\%(char1\|char2\|...\|char100500\)' though it
will be even slower.
Original message:
> On 13/06/11 15:02, Dennis low wrote:
> > Hi
> >
> >
> > I would like to know how to write a command for selecting a range of
> > Chinese text in vim.
> >
> >
> > As I know I can have a command like [a-zA-Z] for the English text.
> > But how to write a command for all the Chinese Text.
> >
> >
> > Example :
> >
> >
> > 我是 Nick Stokes 45678 罪行调查科人员
> > 介意我问你些问题吗?
> >
> >
> >
> > I would to select all these Chinese text exclude the English and
> > Numeric.
> > So where by I can make replacement or changes for the English and
> > Numeric only.
> >
> >
> > Thanks in advance.
> >
> >
> > Dennis
>
> Well, in Vim /[] constructs are limited to approximately 256 character
> values (or maybe 257), which is far too few even for only the hanzi
> taught in Chinese grade schools. If your English text is known to be
> Latin1, with none of the "additional" characters such as the French oe
> and OE digraphs, the uppercase Y-diaeresis, or the non-Western
> diacritics, then you might try to identify hanzi as anything above 0xFF:
> assuming 'nocompatible' mode, searching on [^\x00-\xFF] might do it:
> this regexp atom matches anything above U+00FF, i.e., any hanzi, but
> (this is the caveat) also any non-Latin letter, any non-Western Latin
> letter, and the above-mentioned œ Œ and Ÿ which are Western (French, at
> least, has a use for them) but not included in Latin 1.
>
>
> Best regards,
> Tony.
No comments:
Post a Comment