如何在 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 ;

  }

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...