Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 亚马逊红移中匹配序列数字的正则表达式_Regex_Amazon Web Services_Regex Lookarounds_Regexp Replace - Fatal编程技术网

Regex 亚马逊红移中匹配序列数字的正则表达式

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

我正在编写一个正则表达式,它匹配字符串中的序列递增数。它在测试中运行良好,但在Amazon红移中不起作用。 有人能帮我吗

正则表达式:

^(?:[^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.*$