Eliminate backtracking in the interpreter for patterns with .* (#51508)
authorPrashanth Govindarajan <prgovi@microsoft.com>
Sun, 18 Jul 2021 13:06:23 +0000 (06:06 -0700)
committerGitHub <noreply@github.com>
Sun, 18 Jul 2021 13:06:23 +0000 (13:06 +0000)
commit7eb749c8b78609865edcad67f57084aa382632a3
treecf5b3f4be900569d25ab90208fe531059234ffaa
parentfe49e55c09cefcedc7b7d0a679267ce76eaf79cd
Eliminate backtracking in the interpreter for patterns with .*  (#51508)

* First cut of look up table for speeding up Go()

* More efficient .* in RegexInterpreter

* sq

* Get more debug info

* Remove assert and add unit test

* Potential unit test

* temp

* Fix a bug

* sq

* Add extra protection to the backtracking optimization

* Add unit test

* Revert

* RegexCompiler changes

* sq

* Remove debug unit tests

* Add a length to the AsSpan call

* Address RegexCompiler comments and add unit tests
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs