Thursday 3 May 2018

Gherkin: Match range of characters

‘-‘ is used to specify the range of characters.

For Example
[a-f,A-F,0-9]{4}
Above regular expression is used to check for 32bit hexa decimal strings.

([1-9][0-9]*)
Above regular expression match a positive integer.
@When("I purchased for \\$([1-9][0-9]*)")
public void i_purchased_for_$(int arg1) throws Exception {
 System.out.println("Purchased for " + arg1 + "$");
}



Previous                                                 Next                                                 Home

No comments:

Post a Comment