Skip to content

Conversation

@jez
Copy link
Contributor

@jez jez commented Jan 20, 2026

The regex:

`{3,}`*

Means "three or more copies of a backtick, followed by zero or more
copies of a backtick." Similarly, the regex:

\~{3,}\~*

Is the same, but with the tilde character.

It looks like the original author of this regex might have misunderstood
the regex repetition operator, thinking that {3,} means "exactly three
copies," or possibly an earlier version of this regex might have
forcibly enabled Vim's support for non-greedy matches.

Regardless, the trailing * regex operator for matching zero or more
copies is redundant and can be removed. This might translate to a minor
performance improvement, but I have not attempted to measure that.

The regex:

    `{3,}`*

Means "three or more copies of a backtick, followed by zero or more
copies of a backtick." Similarly, the regex:

    \~{3,}\~*

Is the same, but with the tilde character.

It looks like the original author of this regex might have misunderstood
the regex repetition operator, thinking that `{3,}` means "exactly three
copies," or possibly an earlier version of this regex might have
forcibly enabled Vim's support for non-greedy matches.

Regardless, the trailing `*` regex operator for matching zero or more
copies is redundant and can be removed. This might translate to a minor
performance improvement, but I have not attempted to measure that.
@jez
Copy link
Contributor Author

jez commented Jan 20, 2026

On pushing to CI, it looks like possibly this change was made to work around a bug in vint.

Separately, it looks like vint is failing to run on Python 3.12

Vimjas/vint#394

@jez jez closed this Jan 20, 2026
@jez jez deleted the jez-codeblock-regex branch January 20, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant