summaryrefslogtreecommitdiff
path: root/src/pkg/regexp/all_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý1-1/+1
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-4/+4
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-1/+2
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-324/+155
2010-06-22regexp: restore accidentally deleted test item.Rob Pike1-0/+1
R=rsc CC=golang-dev http://codereview.appspot.com/1714044
2010-06-22regexp: bug fix: need to track whether match begins with fixed prefix.Rob Pike1-1/+2
Fixes issue 872. R=rsc CC=golang-dev http://codereview.appspot.com/1731043
2010-06-02 Optimization to regexp _CharClass: keep track of overall range ofKyle Consalus1-4/+32
charclass to avoid unnecessarily iterating over ranges. Also, use the fact that IntVector is an []int to avoid method calls. On my machine, this brings us from ~27500 ns/op to ~17500 ns/op in the benchmark I've added (it is also faster in the case where a range check doesn't help, added a benchmark for this too.) I'd also like to propose that "[]", and "[^]" be disallowed. They aren't useful as far as I can tell, they aren't widely supported, and they make reasoning about character classes a bit more complicated. R=r CC=golang-dev http://codereview.appspot.com/1495041 Committer: Rob Pike <r@golang.org>
2010-04-26regexp: allow escaping of any punctuationRuss Cox1-0/+9
More in line with other regexp packages and egrep; accommodates overzealous escapers. R=r CC=golang-dev http://codereview.appspot.com/1008041
2010-03-07regex: Remove unneeded imports from test.Christopher Wedgwood1-3/+0
R=rsc, adg, r CC=golang-dev http://codereview.appspot.com/264041 Committer: Rob Pike <r@golang.org>
2010-03-07regexp: add ReplaceAllFunc and ReplaceAllStringFuncAndrew Gerrand1-0/+46
R=r CC=golang-dev http://codereview.appspot.com/247041 Committer: Andrew Gerrand <adg@golang.org>
2010-02-25strings: delete Runes, BytesRuss Cox1-5/+5
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-17The prefix optimization applies only to the first iteration.Rob Pike1-1/+4
Fixes issue 596. R=rsc CC=golang-dev http://codereview.appspot.com/206101 Committer: Rob Pike <r@golang.org>
2009-12-24Add query to find number of subexpressions.Peter Froehlich1-0/+28
This was convenient for me to have without being forced to parse the regexp myself. I'd understand if it's not really wanted, but I also think that some meta information about compiled regexps would be fine. R=r, rsc CC=golang-dev http://codereview.appspot.com/183044 Committer: Rob Pike <r@golang.org>
2009-12-151) Change default gofmt default settings forRobert Griesemer1-103/+103
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 4th set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180049
2009-11-23fix bug in prefix code: must stop one character before any potential match ↵Rob Pike1-0/+2
of an empty string Fixes issue 308. R=rsc CC=golang-dev http://codereview.appspot.com/157142
2009-11-19add a match arena to regexp to avoid generating garbage.Rob Pike1-0/+27
simple regexps run 20x faster. the regex-dna benchmark goes 3x faster. R=rsc CC=golang-dev http://codereview.appspot.com/156108
2009-11-19two easy optimizations for regexp:Rob Pike1-0/+5
1) if char class contains a single character, make it a single character. (this is used to quote, e.g. [.] rather than \. 2) if regexp begins with ordinary text substring, use plain string match to start engine R=rsc CC=golang-dev http://codereview.appspot.com/157095
2009-11-14move evaluation of null-matching instructions one iteration earlier.Rob Pike1-10/+6
performance hit of about 20% but more intuitive results for submatches. we need a good regexp package at some point. Fixes issue 110. R=rsc CC=golang-dev http://codereview.appspot.com/152131
2009-11-12remove dead code from testRob Pike1-68/+8
R=rsc CC=golang-dev http://codereview.appspot.com/152118
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-3/+3
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-29/+29
R=rsc, r http://go/go-review/1025029
2009-10-08more lgtm files from gofmtRuss Cox1-3/+3
R=gri OCL=35485 CL=35488
2009-10-07apply gofmt to rand reflect regexp rpc runtime sort strconv strings sync ↵Russ Cox1-93/+95
syscall testing time unicode unsafe utf8 R=gri DELTA=1409 (79 added, 24 deleted, 1306 changed) OCL=35415 CL=35437
2009-09-15more "declared and not used".Russ Cox1-5/+5
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-08-12convert non-low-level non-google pkg codeRuss Cox1-1/+0
to whole-package compilation. R=r OCL=33070 CL=33101
2009-08-11make a simpler regexp implementation with fewer dependencies and put it ↵Rob Pike1-14/+14
inside testing. remove "regexp." from regexp tests. R=rsc DELTA=1173 (1152 added, 1 deleted, 20 changed) OCL=33028 CL=33037
2009-08-09Add methods AllMatches, AllMatchesString, AllMatchesIter,Stephen Ma1-0/+99
AllMatchesStringIter, based on sawn and sawzall functions in sawzall. APPROVED=rsc DELTA=218 (218 added, 0 deleted, 0 changed) OCL=32408 CL=32949
2009-08-05support []byte (more efficient) as well as string in the interfaces.Rob Pike1-5/+57
change the names; Match is for []byte and MatchString is for string, etc. R=rsc DELTA=195 (155 added, 0 deleted, 40 changed) OCL=32800 CL=32800
2009-08-05special case: recognize '[^\n]' and make it as fast as '.'Rob Pike1-0/+2
R=rsc DELTA=25 (23 added, 1 deleted, 1 changed) OCL=32793 CL=32799
2009-06-18Add a ReplaceAll method to Regexp.Steve Newman1-0/+122
APPROVED=r,rsc DELTA=189 (187 added, 0 deleted, 2 changed) OCL=30205 CL=30517
2009-06-09mv src/lib to src/pkgRob Pike1-0/+235
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102