检查edittext是否包含字符和数字的组合
答案 0 :(得分:0)
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
editText.getText().toString().trim();
// MATCH IT HERE WITH THAT REGEX
// COMBINATION OF ONE LETTER AND ONE DIGIT ([a-zA-Z])(\d)
// COMBINATION OF LETTERS AND DIGITS AFTER ([a-zA-Z]*)(\d*)
}
@Override
public void afterTextChanged(Editable s) {
}
});