Open jgrey4296 opened 11 months ago
HI @jgrey4296,
sorry I didn't take the time to review this earlier. In principle I think this is going in the right direction, but we need to make sure to not break any existing configurations.
I would suggest that we introduce a config variable auto_escape = true
, where the default is true
and if you want to include regex syntax in your version pattern, you need to set it to auto_escape = false
.
It might then be appropriate, to skip all of RE_PATTERN_ESCAPES
, and not just the ones you commented out.
What do you think?
no worries, and yeah that makes sense. I'll get on that :)
This adds basic support for whitespace patterns by altering how regex's are compiled, no longer escaping
+
and*
symbols. To handle this when rewriting lines, areplacement_pattern
is added toPattern
, allowing a pre-formatted version string to be subbed into the matching line directly. This means no changes are made to_format_segment
.A couple of tests are added to show it working, and
test_v1_error_bad_pattern
breaks... but I have no idea why because I didn't touch v1 pattern code.