Skip to content

Generated regex for ? character is incorrect #494

guyburton opened this Issue Apr 1, 2013 · 3 comments

2 participants


With cucumber 1.1.2_0 (from Java), the autogenerated regex for a statement containing a ? character is incorrect and does not match at runtime.


Then is there an error?:

Produces the output

You can implement missing steps with the snippets below:
@Then("^is there an error?:$")
public void is_there_an_error_(DataTable arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
// For automatic conversion, change DataTable to List
throw new PendingException();

Should be:

@Then("^is there an error\\?:$")

Extension of #215


Will submit pull request adding ? to the list of 'special characters' to be escaped. Would be better not to have to 'maintain' this list in general, but not sure of a better way.

Cucumber member

@guy127917 sounds good. The list of special characters isn't that long, so it shouldn't be that hard to cover them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.