Page 1 of 1
Find files with any Chinese characters in the name
Posted: 17 Dec 2019 13:57
by admin
I just needed to find all files with any Chinese characters in the name. But, hmmm, could not find a way in XYplorer.
1) Is there a way that I just did not see (I'm no RegExp man)?
2) Should I add a way to do this (search files by a certain range of characters in the name)?
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 14:21
by highend
Probably something like (this is a regex range)
[\u4E00-\u9FFF\u6300-\u77FF\u7800-\u8CFF\u8D00-\u9FFF]+
But maybe you need to extend this (look e.g. at:
https://stackoverflow.com/a/11415841)
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 15:47
by Marco
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 16:02
by admin
Cool, this seems to work good enough in Quick Search:
Code: Select all
>[\u4E00-\u9FFF\u6300-\u77FF\u7800-\u8CFF\u8D00-\u9FFF]+
What is the meaning of the final +?
And, to show all files with any character above the ANSI range (0-255)? I thought this should work, but it does not:
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 16:12
by highend
At least one, up to unlimited matches of one of the chars inside the range
Don't know why it doesn't work in XY. It works in RegexBuddy...
E.g. Search: [\u0100-\uFFFF]+
Replace: -
Source: a鿌b鿍c
Result: a-b-c
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 16:30
by admin
Made some tests:
>[\u0130-\uFFFF]+ matches lots of files.
>[\u0131-\uFFFF]+ matches only a few files.
But I don't see the pattern. Do you?
\u0130 = 0x0130 = decimal 304
echo chr(0x0130); //LATIN CAPITAL LETTER I WITH DOT ABOVE (see
https://unicodemap.org/details/0x0130/index.html)

This character is not existing in any of my filenames...
Re: Find files with any Chinese characters in the name
Posted: 17 Dec 2019 16:43
by highend
But I don't see the pattern. Do you?
Nope.
Re: Find files with any Chinese characters in the name
Posted: 19 Dec 2019 00:03
by Marco
Probably because
https://stackoverflow.com/questions/469 ... javascript
Anyway, the VF to find all Han ideograms is
Code: Select all
"\p{Han}" >[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FCC\uF900-\uFA6D\uFA70-\uFAD9]|(?# \U00020000-\U0002A6D6 <<<)\uD840[\uDC00-\uDFFF]|[\uD841-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6](?#>>>)|(?# \U0002A700-\U0002B734 <<<)\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34](?#>>>)|(?# \U0002B740-\U0002B81D <<<)\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D](?#>>>)|(?# \U0002F800-\U0002FA1D <<<)\uD87E[\uDC00-\uDE1D](?#>>>)
(which is the expansion of
\p{Han})
Re: Find files with any Chinese characters in the name
Posted: 19 Dec 2019 09:39
by admin
Interesting, thanks!