Skip to content

vpcre: Added 'Non-greedy quantifiers' fix #26579#26582

Merged
spytheman merged 9 commits into
vlang:masterfrom
penguindark:vpcre
Feb 12, 2026
Merged

vpcre: Added 'Non-greedy quantifiers' fix #26579#26582
spytheman merged 9 commits into
vlang:masterfrom
penguindark:vpcre

Conversation

@penguindark

@penguindark penguindark commented Feb 11, 2026

Copy link
Copy Markdown
Member

What's in

  • added support for non greedy quantifiers *?, +?, ??
  • tests for non greedy quantifiers
  • modified examples

Note: this new feature require more tests in future
This PR should solve the issue #26579

A.I. support: Gemini 3 Pro Preview

@penguindark penguindark changed the title vpcre: Added **Non-greedy quantifiers** vpcre: Added 'Non-greedy quantifiers' fix #26579 Feb 11, 2026

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to keep the backwards compatibility with the vlang/pcre module.

I do not see why were the shims for that removed?

They were added in 5b2db04, and are:
pub fn (m Match) get(idx int) ?string {
pub fn (m Match) get_all() []string {
pub fn new_regex(pattern string, _ int) !Regex {
pub fn (r Regex) match_str(text string, start_index int, _ int) ?Match {

Also why was the example edited at all, given that it does not exercise the non greedy qualifiers feature?

Imho it and the shims should be restored, and if needed, another example can be added, that shows the new feature too. I am also perfectly fine for it to be just tested, without an example - a regex engine is a complex thing, and not all of its features can be shown in an example, they just need to be documented/tested.

@penguindark

Copy link
Copy Markdown
Member Author

@spytheman 👍 ok I'm not a fan of it but it can be easily implemented, I'll do asap as I'll have few spare time.

@spytheman

Copy link
Copy Markdown
Contributor

@spytheman 👍 ok I'm not a fan of it but it can be easily implemented, I'll do asap as I'll have few spare time.

Thank you 🙇🏻 .

@penguindark

Copy link
Copy Markdown
Member Author

Thank you 🙇🏻 .

Done 🙇

@spytheman

Copy link
Copy Markdown
Contributor

Excellent work.
Thanks.

@spytheman spytheman merged commit 41d9d85 into vlang:master Feb 12, 2026
77 of 78 checks passed
@penguindark penguindark deleted the vpcre branch February 14, 2026 20:47
cestef pushed a commit to cestef/v that referenced this pull request Mar 9, 2026
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.

2 participants