Teradata 中的正则表达式语法 [英] Regex syntax in teradata
问题描述
在像REGEXP_REPLACE
、REGEXP_SIMILAR
这样的函数中,我们需要提及匹配字符串一部分的正则表达式.regex 是否遵循与 java 中的 regex 相同的语法,或者 Teradata 是否有单独的正则表达式语法?
In functions like REGEXP_REPLACE
, REGEXP_SIMILAR
we need to mention the regular expression for matching a part of the string. Does the regex follow same syntax as that of regex in java or does Teradata have a separate syntax for regular expressions?
推荐答案
我有同样的问题,因为没有令人满意的答案开始调查.根据 这个来自 Teradata 员工的支持论坛回答,它是 POSIX Extended Regular表达式 (ERE) 风味.
I had the same question and since there was no satisfying answer started to investigate. According to this support forum answer from a Teradata employee, it is POSIX Extended Regular Expressions (ERE) flavor.
我试图找出 TD14.10 使用的标准,我发现它是符合 ANSI SQL 2008.我发现必须是 POSIX 标准ERE.
I tried to find out what standard TD14.10 is using, I just found it is ANSI SQL 2008 compliant. Which I found have to be POSIX standard for ERE.
我检查了其他供应商 (Oracle),他们有 POSIX-ERE 和一些PCRE 扩展.[:word:] 是 POSIX 非标准的,但有些正则表达式的实现正在理解它.
I checked other vendors (Oracle) and they have POSIX-ERE with some PCRE extensions. The [:word:] is POSIX non-standard, but some implementations of regexp are understanding it.
这篇关于Teradata 中的正则表达式语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!