【发布时间】:2021-01-02 16:03:34
【问题描述】:
我正在编写一个匹配字符串中序列递增数字的正则表达式。它在测试中运行良好,但在 Amazon Redshift 中不起作用。 谁能帮帮我
正则表达式:
^(?:[^1]*)1(?:[^2]*)2(?:[^3]*)3(?:.*)$
例如匹配字符串(正确):
123
1331213
12222211323
17397462453
1abcd2abcd3abcd
https://regex101.com/r/zkUMxG/1/
当我在亚马逊使用它时,得到错误:
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] -----------------------------------------------
【问题讨论】:
标签: regex amazon-web-services regex-lookarounds regexp-replace