insights: improve whitespace hints for capture groups
Created by: Joelkw
It's easy to miss whitespace side effects when creating regex capture groups. Some examples:
- Not using
\s
means our regex interpreter handles - Using
(.*)
instead of([\d\.]+)
for a version string can also capture things like1.1
and count it as a separate group from1.1
no spaces.
We should assist users in avoiding these mistakes.
Some concepts to explore:
- Warning users if they have either a .* or a
- Automatically stripping trailing (and leading?) spaces from capture group results before aggregation
- We'd need to make sure that this didn't limit the use cases – python, for example, uses the whitespace as part of the syntax (for leading spaces)
- The ability to somehow preview the capture groups and possible space collisions before running
One customer's example with this situation can be found here.