I'm wondering how to to delete all of a specific character using regex but the 1st one in the name. For example I wish to remove all - characters except the 1st one. Or I want to remove all . characters except the first one (and of course would have to add in the condition not to remove from the file extension).
This is not a "regular" but a "standard scripting language" expression, which removes hyphens from the filename except the first hyphen from the left side (apply it as one line).$left(%_filename%,$strchr(%_filename%,'-'))
I'm not sure if I completely understand what you want,
but I try to give a resolution for how I understood your question:
this replaces several successive '-' and keeps one .
E.g. "This----or that----" will be "This-or that-" afterwards.
(BTW: %_FILENAME% is always the name without the extension; to also replace it in the extension, you would have to use %FILENAME_EXT% instead)
If you want to replace other characters, put it in the above bracket.
To replace special characters, like the dot '.' (which have special meanings in regular expressions) you have to preceed them with a '':
This replaces several '.' with one '.'
(you can also replace more than one character at once:
replaces multiple successive '-', '_' and '.' characters with the corresponding single character.
e.g. "This__is--My...Special....File---name" will be "This_is-My.Special.File-name"
Is this what you try to do?
Ah that makes sense now.
Thanks a lot that worked. I have only been using regular expressions up to now so I'm going to have to look into how those functions work.
I looked up some stuff on Lookbehind to try and do this alternatively with regex but the syntax does not seem to be correct. It doesn't look like mp3tag supports it.
It's supported with fixed length.
Ah. Well fixed length wont be any use in this case.