Assistance with a RegEx

Greetings, all...

I am still fairly new to Mp3tag, but after experimenting with various programs have found this is by far the most intuitive and most versatile software around (thanks, guys, for that!)

Having recently built up an extremely large music collection, I came to the conclusion I needed to familiarize myself with expressions and actions so that I could better organize my library. I'm still in my infancy of learning RegEx (Dano's link on the RegEx clinic has been helpful, though I'm still reading over the documentation).

My issue is this: I'm attempting to create an action via RegEx that simply replaces all instances of a comma "," with a semi-colon ";" within a composer field. That, in itself, is pretty simple (as a replace action would suffice). However, I want to add a qualifier that if any comma is followed by a space and "Jr." that it would be exempt from being replaced.

For example:

Tom Jones, Bill Miller would ---> Tom Jones; Bill Miller

However,

Tom Jones, Bobby Ray Simmons, Jr. would ---> Tom Jones; Bobby Ray Simmons, Jr. (instead of Bobby Ray Simmons; Jr.)

I could not find this expression anywhere on the forum or in the FAQ. I apologize if it was posted but I could not find it. I also apologize if this is on the wrong forum, but it seemed this was the proper place for this question from what I could tell.

Thanks in advance for any help you could provide!

$regexp(%artist%,',(?! Jr.)',:wink:

(?! Jr.) is a "negative lookahead". Lookaheads are part of the regular expression, but they don't get replaced.
I learned this here:
http://www.regular-expressions.info/lookaround.html

Thanks, man!

BTW, I am getting around to installing your Discogs script later this weekend. By the looks of things, it's going to be a big help.

To make that a little more useful you may want to add "Sr", "II", "III", "IV" and make the period following "Jr" and "Sr" optional.

Great point.

Could I put a bracket around J or S to do either?

So the parenthesis could look like (?! [SJ]r)?

like this:
$regexp(%artist%,',(?! (Jr|Sr|I|II|III|IV|V|The)\b)',:wink:

@SpecialK
[SJ]r would also work for just "Sr" or "Jr". But don't forget the period or something which marks the end of the word. Because if not, things get mixed up with words like Sri Lanka.
\b does a good job here. It catches a period, for a space end the end of the line. An alternative would be (.| |$)

Appreciate the addendum.

Also, while I'm thinking about it, I forget how to treat a forward slash as a literal. I'd like to do the same thing for a "/" as I did a comma (i.e. replace it with a semi-colon). Or rather, I'd like to replace a forward slash and make sure there's a space after it (i.e. Jones/Miller ---> Jones; Miller)

Do I just add a second forward slash to make the second a literal?

Forward Slash / is always a literal
Backward Slash </b> has to be written \\ to match a literal.

for
Jones/Miller ---> Jones; Miller
Jones / Miller ---> Jones; Miller

$regexp(%artist%,\s?/\s?,; )

EDIT:
And to avoid AC/DC --> AC; DC

$regexp(%artist%,\s?/\s?(?!DC\b),; )

Perfect. I can't say enough how much I am grateful for everyone's help. As I said earlier, I installed your script tonight, and I'm anxious to begin using it.

This question is kind of off-topic, but since I have your attention, do you know much about Album Art Exchange? I've looked at toying around with Web Sources, but that's probably still too far beyond my comprehension level. I want to pull album art from there, but I'm not certain their results are tailored to retrieval through the normal scripting process. If you have a chance to take a quick look, I'd be forever indebted lol

I mainly use my google images script if I want Album Art only. It finds pretty much everything as it uses google images. The only problem are selftitled albums (band name = album name). There you get mainly artist pictures. But trying different search words ("album", "cover", the release year) helps in most cases.
/t/11166/1

There are also various album art scripts from dano:
/t/2706/1

And I have installed two Album Art script for Amazon (amazon.com & amazon.de). Don't know where I have these from. I guess the come with the Mp3tag installation.

Mp3tags Web Sources can give you only one picture per album. If you are looking for front, back, inlay, disc, artist-picture, you have to use a different tool or store them manually with Mp3tag.
At the "Adjust tag information" dialog, you can select at the "Utils" button down left, if the picture should be stored in the ID tag or/and as a extra file in the folder.

EDIT:
ah, I didn't know that "Album Art Exchange" is a specific web site. There is no script for this at the moment. From a quick look at it I guess it could be done without to much problem.

Yes, its a specific website. I like it because it has a pretty good selection and it's mostly high-resolution images. I'd like to be able to search using that site with a web source script, but I know I am not ready to be able to make it work. While I've looked at the script templates, I don't know enough about them yet to make one work.

I had a second lokk at albumartexchange.com . It's not possible. They use captchas and they don't allow direct linking to pictures. So scripting is not possible for their site.

Thanks for looking at that for me. That's exactly what I suspected, but needed a second opinion.