02
Jan

Optional text for cucumber steps definition

Optional text
It's grammatically incorrect to say 1 cucumbers, so we should make the plural s optional. That can be done by surrounding the optional text with parentheses:

I have {int} cucumber(s) in my belly
That expression would match this text:

I have 1 cucumber in my belly
It would also match this text:

I have 42 cucumbers in my belly
In Regular Expressions, parentheses indicate a capture group, but in Cucumber Expressions they mean optional text.