Regex issue Chinese / English problem VERY COMPLEX

General discussion related to "Everything".
Post Reply
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Regex issue Chinese / English problem VERY COMPLEX

Post by Debugger »

Name search problem (complex regular expressions)
I have written many regexes, tested an 101Regex but it still does not find what I expect

I want to match file names with the following criteria:

Code: Select all

Files start with  Example:
【DU独】任
【DU独】萧
【DU独】张
A Chinese (NOT ENGLISH!) character as part of the artist's name follows.
In the name is the name of the artist and I want the year 2022, or 2023 or 2024 to choose one year I want to know)
The file extension is .mp3.

Regex matches 35 or 41 names, for example, but does not match all of them

Code: Select all

【DU独】([^】]+) - .+\(DjB Electro Rmx 2022\).mp3
【DU独】[\u4e00-\u9fff]+ - .+\(DjB Electro Rmx 2022\)\.mp3
【DU独】.*[\u4e00-\u9fff]+.*\(DjB Electro Rmx 2022( [\u4e00-\u9fff]+)?\)\.mp3
If I am looking for a more advanced way to match Chinese characters in file names, it can indeed be a challenge, especially because of the variety of characters in Chinese of different spaces and Unicode :(
Thy Grand Voidinesss
Posts: 690
Joined: Wed Jun 01, 2022 5:01 pm

Re: Regex issue Chinese / English problem VERY COMPLEX

Post by Thy Grand Voidinesss »

For comparison you could check if your regular expressions are yielding same [wrong] results when used the Filter box in Mp3tag; and / or if issues with filenames / Everything persists simply use Mp3tag / tag fields instead

https://docs.mp3tag.de/filter/
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Regex issue Chinese / English problem VERY COMPLEX

Post by Debugger »

Writing complex expressions or scripts is a hassle. The only solution in seconds is to type a partial name and sort by name. This works instantly, but I don't know if it does in all cases. It sorts the English names first and then the Chinese names, and I'm just interested in only the initial Chinese names.
Post Reply