Cucumber regex step definition
问题 Can someone explain what is the difference between @When("some text (.*)") and @When("^some text ([^\"]*)$") ? The former worked when using a straightforward step, but when using a data table it maps only to the first table item. 回答1: Here is explanation of couple of common regex : .* matches anything (or nothing), literally “any character (except a newline) 0 or more times” .+ matches at least one of anything [0-9] or d matches a series of digits (or nothing) [0-9]+ or d+ matches one or more