doctrine/doctrine2 — pull request #717 by hackedd (2013-07-04 08:19:19+00:00)
Title: Allow query parameters starting with an underscore

Using a query parameter of which the name starts with an underscore results in a QueryException. For example:

``` php
$q = $em->createQueryBuilder()
->select("u")
->from("User", "u")
->where("u.username = :_name")
->setParameter("_name", "bar")
->getQuery();
```

Results in:

Invalid parameter format, : given, but : or ? expected.

This happens because of a bug in the Lexer, which recognizes `:_name` as two tokens (the `:` as the start of a input parameter, `_name` as an identifier). The attached patch changes the regular expression for input parameters to allow identifiers starting with a letter or underscore.