- x <- c("gender_gender-1", "county_county-2", "country_country-1997", "country_country-1993", "county-county-county-2") 
- gsub("^(.*?)(?:[,_\\s-]\\1)+", "\\1", x, perl=TRUE) 
				eCA8LSBjKCJnZW5kZXJfZ2VuZGVyLTEiLCAiY291bnR5X2NvdW50eS0yIiwgImNvdW50cnlfY291bnRyeS0xOTk3IiwgImNvdW50cnlfY291bnRyeS0xOTkzIiwgImNvdW50eS1jb3VudHktY291bnR5LTIiKQpnc3ViKCJeKC4qPykoPzpbLF9cXHMtXVxcMSkrIiwgIlxcMSIsIHgsIHBlcmw9VFJVRSk=