I have a statement
Scenario Outline
@Given I have a coupon for "<campaign_name>"
Examples:
|Hotel|
|Movie|
|Shopping|
For this statement I have regex as:
@Given("^I have a coupon for \\\"([^\\\\\\\"]*)\\\"$")
I want to test this statement on popular online regex tool https://regexr.com/
Where it is failing, how come it is passing in Cucumber?
Also, if I do reverse i.e. a regex passing in tool, then it fails in Cucumber.
If I use
@Given("^I have a coupon for [^]*$")
it will fail.
I want to write good, optimum, readable, short regex, for that I am dependent on tool. Please check, what am I doing wrong?