Commit graph

11 commits

Author SHA1 Message Date
Cyril Tovena 9733377257
Review feedback
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-06 16:29:16 +02:00
Cyril Tovena f32ec95722
Add more tests and support begin/end text.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-06 16:22:48 +02:00
Cyril Tovena d217825af8
guards against too many matches.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 16:46:24 +02:00
Cyril Tovena 639cd00721
Uses the variadic function.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 15:59:40 +02:00
Cyril Tovena 623c3ebeec
Remove redundant code and support charclass without base.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 15:16:21 +02:00
Cyril Tovena 7ea8609024
typo
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 13:54:55 +02:00
Cyril Tovena 453cc5de75
Add a comment for the charclass limit.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 13:52:12 +02:00
Cyril Tovena c751cfbfce
Improve findSetMatches to support concatenation.
This improves how we find `SetMatches` for regexp. Notably it allows to support concatenation
such as `api_(v1|prom)_push` for which the resulting set matches are `api_v1_push` and `api_prom_push`.

I had to support characters classes too since the syntax may try to optimize alternates with them.

In the end the code is also more robust than the previous implementation relying on the stringyfied version of the regexp.

This could be upstreamed later.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 13:43:41 +02:00
Brian Brazil 924ce978b7
Don't do literal regex matching optimisation when case insensitive. (#8013)
Fixes #7994

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2020-10-06 13:16:26 +01:00
Marco Pracucci 2f6bf7de4c
Optimise labels regex matchers containing a literal within the pattern (#7503)
* Added labels matchers regex fast path for literals within the regex

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2020-07-07 09:38:04 +01:00
Marco Pracucci cef4dd6fff
Optimized label regex matcher with literal prefix and/or suffix (#7453)
* Optimized label regex matcher with literal prefix and/or suffix

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Added license

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Added more tests cases with newlines

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Restored deleted test

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2020-06-26 15:19:09 +05:30