in reply to question : regex

If I understood your question correctly: s/__[a-zA-Z]{1,2}_(?:[a-zA-Z]_)?/__/