Q:

Regex Find last character is an alphabet

Hi everyone I am new here and I would like to know how to find in a string, last character is an alphabet. my string goes like this:
 String a = "1:50A"
 String b = "E20S"
 String c = "1:20A"
 String d = "1:23B"
 String e = "1:43C"
 final String REGEX = "([a-z]*[A-Z])+$";;
 ArrayList<String> list = new ArrayList<String>();
list.add(a);
list.add(b);
list.add(c);
list.add(d);
list.add(e);

for(String s : list){
Pattern pattern = Pattern.compile(REGEX);
Matcher match = pattern.matcher(s);

if(match.find()){
    //Do something with this
}

else{
     //do something with this
}

I want to create a Regular expression in term that it will only search for the last character and if it is a capitalized alphabet.

A:

The following regular expression would match strings ending in a capital letter
(.*[A-Z])$

The problem with your expression was the [a-z]* which matches zero or more lower case letters, your input has colon (:) and numbers too which it would not match 

