If url path contains text, but doesn't contain other text?

If url path contains text, but doesn't contain other text?

Hey Guys,

I have three url paths I need to check the text strings in them and do different stuff for each one.

My paths are:
Audio/! Singles !/
Audio/Albums/- Various Artists -/
Audio/Albums/

These folders all contain numerous other folders one for each album, Some also have sub folders for multi disk sets.

What I need to do is run a different script depending on what folder it is in.
So far I have:

  1. var test = $('#pathname').text();

  2. if (test.toLowerCase().indexOf("! singles !") >= 0)
    {do stuff - this one works fine.}
    else if (test.toLowerCase().indexOf("albums") >= 0)
    {do stuff - This one works too.}
    else(test.toLowerCase().indexOf("- various artists -") >= 0)
    {do stuff - This doesn't work so good}
The Various Artists part fires with the code from the Album part as well, because the various artists folder is in the audio folder. Is there a way to say if url contains albums, but doesn't contain various artists? I've been looking, but had no luck. Is there a better way to do the same thing?

Thank you for any help received.