test<-c("Score (ABC): 2 (of 100); see note","Amount of ABC; 30%","Presence of ABC: negative") test<-regmatches(toupper(test), gregexpr("[:;][^;]*", toupper(test), perl=TRUE))test<-gsub("\\([^()]*\\)|\\D", "", test)test