Skip to content

docs: regex library non-capture support #18900

Closed

Description

@odewdney

Documentation URL

https://docs.micropython.org/en/latest/library/re.html

Description

The documentation states that non-capture groups are not supported:

  • non-capturing groups ((?:...))

But at https://github.com/micropython/micropython/blob/master/lib/re1.5/compilecode.c#L92 it looks like it is supported.

int capture = re[1] != '?' || re[2] != ':';

And

import re
re.match("(?:.)","1")

returns

<match num=1>

suggesting that it works.

Code of Conduct

Yes, I agree

Activity

  1. agatti commented on Mar 12, 2026

    @agatti
    Contributor

    Nice find! Thanks for reporting this, I've submitted a PR that updates the documentation bits in question.

  2. added a commit that references this issue on Mar 17, 2026
    df9b714
  3. added a commit that references this issue on Sep 21, 2026
    a4ca8b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions