如何在 Talend 中检查包含字母和数字的列

How to check column that contain letter and number in Talend

我的专栏必须像这样包含 2 个字母4 个数字 (AV1234)

我该如何检查?

您可以使用 talend 文档 here 中提到的 sql 模板,并且您可以使用正则表达式检查包含字母和数字的列。

使用这个[a-zA-Z]{2}[0-9]{6}

使用这个如果你只想要大写字母[A-Z]{2}[0-9]{6}

[a-zA-Z]    # Match a single character present in the list below
            # A character in the range between “a” and “z”
            # A character in the range between “A” and “Z”
  {2}       # Exactly 2 times
[0-9]       # Match a single character in the range between “0” and “9”
  {6}       # Exactly 6 times

谢谢您的回答! 有效

我的套路代码:

public static Boolean MyPattern(String str) {


String stringPattern = "[A-Z]{2}[0-9]{4}"; 

boolean match = Pattern.matches(stringPattern, str);


return match ;

  }