-- Test quantified backref within a larger expression select'abc abc abc' ~ '^(\w+)( \1)+$'as t; select'abc abd abc' ~ '^(\w+)( \1)+$'as f; select'abc abc abd' ~ '^(\w+)( \1)+$'as f; select'abc abc abc' ~ '^(.+)( \1)+$'as t; select'abc abd abc' ~ '^(.+)( \1)+$'as f; select'abc abc abd' ~ '^(.+)( \1)+$'as f;
-- Test some cases that crashed in 9.2beta1 due to pmatch[] array overrun select substring('asd TO foo'from' TO (([a-z0-9._]+|"([^"]+|"")+")+)'); select substring('a'from'((a))+'); select substring('a'from'((a)+)');
-- Test for proper matching of non-greedy iteration (bug #11478) select regexp_matches('foo/bar/baz', '^([^/]+?)(?:/([^/]+?))(?:/([^/]+?))?$', '');
-- Test that greediness can be overridden by outer quantifier select regexp_matches('llmmmfff', '^(l*)(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*){1,1}(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*){1,1}?(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*){1,1}?(.*){1,1}?(f*)$'); select regexp_matches('llmmmfff', '^(l*?)(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*?){1,1}(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*?){1,1}?(.*)(f*)$'); select regexp_matches('llmmmfff', '^(l*?){1,1}?(.*){1,1}?(f*)$');
-- Test for infinite loop in cfindloop with zero-length possible match -- but no actual match (can only happen in the presence of backrefs) select'a' ~ '$()|^\1'; select'a' ~ '.. ()|\1'; select'a' ~ '()*\1'; select'a' ~ '()+\1';
-- Test incorrect removal of capture groups within {0} select'xxx' ~ '(.){0}(\1)'as f; select'xxx' ~ '((.)){0}(\2)'as f; select'xyz' ~ '((.)){0}(\2){0}'as t;
-- Test ancient oversight in when to apply zaptreesubs select'abcdef' ~ '^(.)\1|\1.'as f; select'abadef' ~ '^((.)\2|..)\2'as f;
-- Add coverage for some cases in checkmatchall select regexp_match('xy', '.|...'); select regexp_match('xyz', '.|...'); select regexp_match('xy', '.*'); select regexp_match('fooba', '(?:..)*'); select regexp_match('xyz', repeat('.', 260)); select regexp_match('foo', '(?:.|){99}');
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.