import java.util.regex.Matcher;
import java.util.regex.Pattern;

class TesteRegex {

    private static final Pattern ABC = Pattern.compile("A+B+C+");

    public static void main(String[] args) {
        String texto = "123 456 7890 ABx AAACCC AABBCC hjkhkk ABBBBCCC djsdhj ABC kdjk.";
        Matcher m = ABC.matcher(texto);
        while (m.find()) {
            System.out.println("Achou nas posições " + m.start() + "-" + m.end() + ": "
                    + texto.substring(m.start(), m.end()));
        }
    }
}