# \[regex?\] How can I remove lines with Chinese characters from the lyrics field?

**URL:** https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441
**Category:** Support
**Created:** [December 19, 2022, 5:12am UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441 "2022-12-19T05:12:24Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 21, 2022, 10:09am UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/21 "2022-12-21T10:09:35Z")

</div>

If you compare

> [@Fratter](#):
>
> Regular expression: [\d\d:\d\d.\d\d]

with

> [@ohrenkino](#):
>
> Search string: `\[\d\d\:\d\d\.\d\d\]`

Then you many notice that the square brackets are treated differently.  
Also, please compare

> [@ohrenkino](#):
>
> `$regexp(%unsyncedlyrics%,'^\[.+?[\x{2E80}-\x{9FFF}\x{F900}-\x{FAFF}\x{FE10}-\x{FE1F}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}](.*?)$',)`

and

> [@Fratter](#):
>
> Format string: $regexp(%unsyncedlyrics%,'^[.+?\x{2E80}-\x{9FFF}\x{F900}-\x{FAFF}\x{FE10}-\x{FE1F}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}$',)

It would be nice if you could either copy the strings accurately by the letter or develop them on your own according to your environment.

Just a hint: you can test the scripting functions in Convert\>tag-Tag and see there in the preview whether the result is as expected

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 11:15am UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/22 "2022-12-21T11:15:26Z")

</div>

It must be something to do with the forum's automatic formatting.

Here's [a screenshot of me composing this reply](https://i.imgur.com/Vfb5aoF.png), with my text on the left and the forum's preview on the right. You can see the difference.

I promise you I didn't type your suggestions in by hand, I merely copied and pasted.

It means, I think, that I've ben typing in the correct strings but they are getting garbled when I put them in a quote in the forum. Not sure how you're managing to keep them intact.

Anyway, regarding `\[\d\d\:\d\d\.\d\d\]`, [this has no effect](https://i.imgur.com/lLmCHLu.png) and this is [what I see in Convert\>tag-Tag](https://i.imgur.com/3v9rPBs.png).

And with `$regexp(%unsyncedlyrics%,'^\[.+?[\x{2E80}-\x{9FFF}\x{F900}-\x{FAFF}\x{FE10}-\x{FE1F}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}](.*?)$',)`, [this](https://i.imgur.com/LSxyyTn.png) returns [the first line of the lyrics and 207 more blank lines](https://i.imgur.com/pMOxUnI.png) (ie. 208 lines - and there were 416 in the original). This is [what I see in Convert\>tag-Tag](https://i.imgur.com/pVQbUAW.png).

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 21, 2022, 11:59am UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/23 "2022-12-21T11:59:41Z")

</div>

This is what the $regexp() function shows on my PC:

 ![grafik](https://community.mp3tag.de/uploads/default/original/2X/3/3d66610db05b8caf910899cae498e5f5b50ec088.png)

(Oh yes: please use the forum upload function or paste the screendumps from the clipboard into the post editor but do not use a third party site to store the pictures. This request and how to embed code parts is described in this thread:

> [@Hints for asking Support Requests](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190):
>
> If you need support using Mp3tag, you can help the community members that are about to support you in finding a solution or workaround to your problem, by following these simple guidelines. Be descriptive, also in what you’ve already tried Please give a short explanation what’s not working as expected or what you’re trying to achieve. It’s best to know any details about the problem at hand and especially, what steps you’ve already tried to solve it by yourself. Helpful information also includ…

)

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 12:16pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/24 "2022-12-21T12:16:10Z")

</div>

Point taken about screenshots. Thank you.

But I'm going to leave this now because another kind, clever soul elsewhere came up with

> `^\[[0-9:\.]{9}\][-]?[^ -~]+([^ -~]|[0-9xW\*\.( )~,-])*+(\r\n|\n)?`

which seems to work perfectly, so now I'm considering this solved (except that I just need to work out how to include _all_ the regular ASCII characters not just x, W, ~ etc.).

I really appreciate you taking so much time to help me out.

Vielen Dank.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 21, 2022, 12:58pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/25 "2022-12-21T12:58:34Z")

</div>

I tested this snipped

> [@Fratter](#):
>
> `^\[[0-9:\.]{9}\][-]?[^ -~]+([^ -~]|[0-9xW\*\.( )~,-])*+(\r\n|\n)?`

and it returns the input string (i.e. "

> [@Fratter](#):
>
> seemingly has no effect.

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 1:27pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/26 "2022-12-21T13:27:15Z")

</div>

I'm horribly confused. I was so excited that it was working.

These are the last three lines (lines 413 to 415) of the UNSYNCEDLYRICS tag before running the action:

`[17:53.624]你想要的全都有，就在爱丽丝的餐厅里。”`  
`[17:59.144]哒哒哒~`  
`[18:01.257]就在爱丽丝的餐厅里~~`

These are the last three lines (lines 207 to 209) after running the action:

`[17:59.144]Da-da da-da da-da da-dum`  
`[18:01.257]At Alice's Restaurant`  
`[by:_Cloudreamer_]`

It not only works well, but it gets rid of all the "15" "W" "~" etc that were left in using other methods. And it removes the whole line (including the timestamps) where there is a Chinese character. Success.

**But**... when I try it on another track with Chinese lyrics, it has no effect. Why is it only working on Alice's Restaurant, I wonder?

The first three lines of the Alice's Restaurant lyrics tag are

`eng||﻿[00:00.000] 作词 : Arlo Guthrie`  
`[00:01.000] 作曲 : Arlo Guthrie`  
`[00:27.558]This song is called Alice's Restaurant, and it's about Alice, and the restaurant.`

The first three lines of the other random track's lyrics tag are:

`eng||﻿[00:00.000] 作词 : Billy Joel`  
`[00:01.000] 作曲 : Billy Joel`  
`[00:15.06]Come out, Virginia. Don't let me wait.`

I can't see what's making a difference?

To be clear, I've uploaded a screenshot of what I ran.

![chinese42](https://community.mp3tag.de/uploads/default/original/2X/6/60c95fb6fca69ca07e76e453260e300313b2ae36.png)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 21, 2022, 1:31pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/27 "2022-12-21T13:31:50Z")

</div>

And have you tested other suggestions in this thread whether they work now?

I am pretty sure that the

> [@Fratter](#):
>
> kind, clever soul elsewhere

will debug it for you.

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 1:40pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/28 "2022-12-21T13:40:16Z")

</div>

I'm sure I've tried everything in this thread. I've put so much effort in and tried to be thorough.

Yes, I'm hoping for a reply from the other person. Touch wood.

What I'm thinking about now, though, is this thing of different tracks behaving differently.

I mean, when I've tried things (things suggested in this thread, for example) that haven't worked for me, it could be that if I'd tried them on a different track, they might have worked.

It's all so bewildering, lol.

But I'll have to revisit the other, older suggestions to see if they work on other tracks.

I've got some other stuff to do now, but I'll be back in touch later or tomorrow (I'm currently in east Asia).

Thank you again 🙏

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 3:26pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/29 "2022-12-21T15:26:39Z")

</div>

I think I might have sorted it out.

That string seems to be looking for 9 characters at the start (the timestamp). Many of the lyrics (in karaoke format) have the seconds to 3 decimal places instead of 2. I think that's why it wasn't working on the other tracks I tried.

So I've moved the action that fixes the decimal place thing to the top of my action group (see attached screenshot), and it seems to work. Do you think that makes sense?

 ![chinese43](https://community.mp3tag.de/uploads/default/original/2X/5/59e2f58749e0318c4ffe7dca31236a330ac3219b.png)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 21, 2022, 3:35pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/30 "2022-12-21T15:35:39Z")

</div>

> [@Fratter](#):
>
> Do you think that makes sense?

The whole action group?  
Then I wonder why you delete the field "Chinese" at the end of this group. Where does it come from?

---

<div class="post-metadata">

### Author: ![Fratter](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fratter/32/12815_2.png) [@Fratter](https://community.mp3tag.de/u/Fratter)
#### Post date: [December 21, 2022, 9:36pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/31 "2022-12-21T21:36:02Z")

</div>

I took the screenshot before I realised that the `<delete chinese>` action was still there.

If you remember, the old way involved splitting the languages into two different fields.

My solution was to write the Chinese stuff to a new field I made called %chinese% (because I didn't want to use %comment%, as I use that field already) and then delete that field once it was no longer needed.

Before I read this comment of yours, I'd already deleted the "delete chinese" bit but I left it in the screenshot because it wasn't really relevant to what we'd been talking about.

It's gone now, as you'll see in this screenshot ...

 ![chinese45](https://community.mp3tag.de/uploads/default/original/2X/a/a2f0b428183ef41a1e36c03c09618bd360e2ded2.png)

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:30pm UTC](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441/32 "2026-02-09T12:30:00Z")

</div>



[Previous page](https://community.mp3tag.de/t/regex-how-can-i-remove-lines-with-chinese-characters-from-the-lyrics-field/59441.md?page=1)
