Skip to content

Improve Regex parameter's usability #152

@dakusui

Description

@dakusui

Right now, users need to specify up to how many times a pattern should be repeated explicitly.

  @ParameterSource
  public Regex.Factory<String> scenario() {
    return Regex.Factory.of("open deposit(deposit|withdraw|transfer){0,2}getBalance");
  }

However, a syntax sugar such as + and * are useful and intuitive.

  @ParameterSource
  public Regex.Factory<String> scenario() {
    return Regex.Factory.of("open deposit(deposit|withdraw|transfer)+ getBalance");
  }
  • ? will be translated to {0,1}
  • + will be translated to {1,2}
  • * will be translated to {0,2}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions