Move files to a folder named after a part of the filenames

wud appreciate a helping hand on this on

The first part of the filenames is the same, then followed by -a- or -b- or -c- and then random text and .ext.

so like:

This is some filename-a-sometext.txt
This is some filename-b-othertxt.txt
This is some filename-c-difftext.txt

Another filename-a-sometext.txt
Another filename-b-othertxt.txt
Another filename-c-difftext.txt

In regex:

(.+)-(a|b|c)-(.+).(\w{3})

then: move to folder \1

However, this will result in an error -foldername already exist.

Any suggestions?

Thanks

Found it - above can be deleted (regretfully I can't do it myself)

Old Name: (.+)-(a|b|c)-(.+).(\w{3})
New Name: \1\\0

=