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}
Right now, users need to specify up to how many times a pattern should be repeated explicitly.
However, a syntax sugar such as
+and*are useful and intuitive.?will be translated to{0,1}+will be translated to{1,2}*will be translated to{0,2}