Regex 亚马逊红移中匹配序列数字的正则表达式
我正在编写一个正则表达式,它匹配字符串中的序列递增数。它在测试中运行良好,但在Amazon红移中不起作用。 有人能帮我吗 正则表达式:Regex 亚马逊红移中匹配序列数字的正则表达式,regex,amazon-web-services,regex-lookarounds,regexp-replace,Regex,Amazon Web Services,Regex Lookarounds,Regexp Replace,我正在编写一个正则表达式,它匹配字符串中的序列递增数。它在测试中运行良好,但在Amazon红移中不起作用。 有人能帮我吗 正则表达式: ^(?:[^1]*)1(?:[^2]*)2(?:[^3]*)3(?:.*)$ 例如,它匹配字符串(正确): 当我在Amazon中使用它时,得到错误: Error running query: Invalid preceding regular expression prior to repetition operator. The error occurre
^(?:[^1]*)1(?:[^2]*)2(?:[^3]*)3(?:.*)$
例如,它匹配字符串(正确):
当我在Amazon中使用它时,得到错误:
Error running query: Invalid preceding regular expression prior to repetition operator. The error occurred while parsing the regular expression fragment: '(?>>>HERE>>>:[^1]*)1(?'. DETAIL: ----------------------------------------------- error: Invalid preceding regular expression prior to repetition operator. The error occurred while parsing the regular expression fragment: '(?>>>HERE>>>:[^1]*)1(?'. code: 8002 context: T_regexp_init query: 19124520 location: funcs_expr.cpp:185 process: query1_107_19124520 [pid=15061] -----------------------------------------------
Amazon Redshift正则表达式基于POSIX()。不支持您的
^(?:[^1]*)1(?:[^2]*)2(?:[^3]*)3(?:*)
表达式包含的非捕获组:有四种(?:…)
模式
删除组altogher,因为您不打算使用它们:
^[^1]*1[^2]*2[^3]*3.*$
^[^1]*1[^2]*2[^3]*3.*$