See discussion on #36564 Adds a simple ad-hoc substring matching pattern language which allows skipping a bounded number of chars between matched substrings. Before this change compiling the regex was taking ~120ms on a fast machine and ~8mb of memory. This new version is way faster and uses minimal memory. Checked the behavior of this vs by running it against 10k licenses that happened to be in my home dir. There were only 4 differences of behavior with the regex implementation, and these were false negatives for the regex implementation that are true positives with the new one. Of the ~10k licenses in my home dir, ~1k do not match one of these licenses, usually because it's GPL/MPL/etc. Release Notes: - N/A
33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
-- 0..512
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
are permitted provided that the following conditions are met:
|
|
|
|
-- 1..5
|
|
Redistributions of source code must retain the above copyright notice, this
|
|
list of conditions and the following disclaimer.
|
|
|
|
-- 1..5 optional:
|
|
Redistributions in binary form must reproduce the above copyright notice,
|
|
this list of conditions and the following disclaimer in the documentation and/or
|
|
other materials provided with the distribution.
|
|
|
|
-- 1..128 optional:
|
|
may be used to endorse or promote products derived from this software without
|
|
specific prior written permission.
|
|
|
|
-- 1..5
|
|
THIS SOFTWARE IS PROVIDED
|
|
-- 1..128
|
|
“AS IS” AND
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
DISCLAIMED. IN NO EVENT SHALL
|
|
-- 1..128
|
|
BE LIABLE FOR
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|