$regexp(%TITLE%,[^0-9a-zA-Z],) does not work

Hi,
to exlude all NON-alphanumeric characters from TITLE, the above regex-command should work but it always gives me a Invalid regular expression.

What's wrong with that?

If I try it with the Convert Tag -> Tag (to see the result in the preview - green box) I don't see any error:

image

Could you please show us with a screenshot where do you get the "invalid regular expression" error message?

BTW:
The regular expression itself should be something like
$regexp(%TITLE%,'[^0-9a-zA-Z]', )
to get
image

To support @lyricslover:
$regexp(%TITLE%,'[^0-9a-zA-Z]',_)
turns
"Class of '96 [Rev. Mix]" into
"Class_of__96__Rev__Mix_"
(which also transforms the space)
or use this:
$regexp(%TITLE%,'[^0-9a-zA-Z ]',_)

Thank you a lot for yout replies!
I already build a workaround with using a TEMP-field and the RegEx-quickaction.
Anyway, here's, what happens on mac:

Oh,this is an observation on the Mac?!
Did you follow the description in the documentation?

The documentation on Scripting Functions states for $regexp:

Please note that you have to escape comma and other special characters in expr.

So the most easiest way would be to just enclose the expression in ' (given that [ and ] are special characters in Mp3tag's Format Strings and Available Placeholders)

$regexp(%TITLE%,'[^0-9a-zA-Z]',)

Thanks a lot, Florian! This works like a charm... :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.