Find files with any Chinese characters in the name

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Find files with any Chinese characters in the name

Post 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)?

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Find files with any Chinese characters in the name

Post 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)
One of my scripts helped you out? Please donate via Paypal


admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Find files with any Chinese characters in the name

Post 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:

Code: Select all

>[\u0100-\uFFFF]+

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Find files with any Chinese characters in the name

Post 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
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Find files with any Chinese characters in the name

Post 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...

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Find files with any Chinese characters in the name

Post by highend »

But I don't see the pattern. Do you?
Nope.
One of my scripts helped you out? Please donate via Paypal

Marco
Posts: 2347
Joined: 27 Jun 2011 15:20

Re: Find files with any Chinese characters in the name

Post 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})
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Find files with any Chinese characters in the name

Post by admin »

Interesting, thanks!

Post Reply