1
0
mirror of https://github.com/golang/go synced 2024-10-03 05:11:21 -06:00
go/src/regexp/testdata
Paul Wankadia 5ccaf0255b regexp/syntax: fix factoring of common prefixes in alternations
In the past, `a.*?c|a.*?b` was factored to `a.*?[bc]`. Thus, given
"abc" as its input string, the automaton would consume "ab" and
then stop (when unanchored) whereas it should consume all of "abc"
as per leftmost semantics.

Fixes #13812.

Change-Id: I67ac0a353d7793b3d0c9c4aaf22d157621dfe784
Reviewed-on: https://go-review.googlesource.com/18357
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-08 16:41:46 +00:00
..
basic.dat
nullsubexpr.dat
re2-exhaustive.txt.bz2
re2-search.txt
README
repetition.dat
testregex.c

AT&T POSIX Test Files
See textregex.c for copyright + license.

testregex.c	http://www2.research.att.com/~gsf/testregex/testregex.c
basic.dat	http://www2.research.att.com/~gsf/testregex/basic.dat
nullsubexpr.dat	http://www2.research.att.com/~gsf/testregex/nullsubexpr.dat
repetition.dat	http://www2.research.att.com/~gsf/testregex/repetition.dat

The test data has been edited to reflect RE2/Go differences:
  * In a star of a possibly empty match like (a*)* matching x,
    the no match case runs the starred subexpression zero times,
    not once.  This is consistent with (a*)* matching a, which
    runs the starred subexpression one time, not twice.
  * The submatch choice is first match, not the POSIX rule.

Such changes are marked with 'RE2/Go'.


RE2 Test Files

re2-exhaustive.txt.bz2 and re2-search.txt are built by running
'make log' in the RE2 distribution https://github.com/google/re2/

The exhaustive file is compressed because it is huge.