如何解决如何在 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 ;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。