Skip to content

POSIX BRE / ERE compliant parsers #858

@tgross35

Description

@tgross35

Hello,

I would like to suggest adding POSIX Basic Regular Expression (BRE) and Extended Regular Expression (ERE) support, possibly via modules e.g. regex::RegexBRE.

The main reason for this is for compatibility with coreutils functions:

  • awk: only supports ERE
  • sed: supports BRE (default) or ERE (with -E)
  • grep: supports BRE and ERE, and sometimes PCRE (but inconsistently, it's not POSIX)

I understand that the use case for this is somewhat narrow and thus perhaps out of the scope of this library. Just wanted to at least bring it up before working on my own implementation, in case there is a need.

The implementation for this could likely just be a basic wrapper that validates the supplied data is POSIX-compliant and performs token substitutions in-place to enable parsing via the default regex engine.

Reference on the syntax: https://en.wikibooks.org/wiki/Regular_Expressions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions