Visitar URL original
Regex with "|" doesn't work · Issue #1830 · google/fuzztest · GitHub
Skip to content

Regex with "|" doesn't work #1830

Open
Open

Description

@nishantwrp

Doing fuzztest::InRegexp(R"(a)|(b)") gives the error

Failed precondition (re != nullptr): Invalid RE2 regular expression.

Is that by design because I am able to do OneOf(InRegexp(R"(a)"), InRegexp(R"(b)")) without any errors

Activity

  1. nishantwrp commented on Aug 17, 2025

    @nishantwrp
    Author

    From fuzztest docs

    You can also use regular expressions to define a string domain. The InRegexp domain represents strings that are sentences of a given regular expression. You can use any regular expression syntax accepted by RE2. For example:

    From re2 docs

    Two regular expressions can be alternated or concatenated to form a new regular expression: if e1 matches s and e2 matches t, then e1|e2 matches s or t, and e1e2 matches st.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions