tjader / esmre

Automatically exported from code.google.com/p/esmre
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Named grouping not supported #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently esmre doesn't support regular expressions with named groups.
For example hints(...) function works well with regexp :
[0-3][0-9]/[0-1][0-9]/[1-2][0-9]{3}
but returns nothing (?P<date>[0-3][0-9]/[0-1][0-9]/[1-2][0-9]{3})

Original issue reported on code.google.com by ibeg...@gmail.com on 26 Sep 2008 at 7:37

GoogleCodeExporter commented 9 years ago
The parser in the hints function is currently very naive, and can't extract 
hints
from inside any kind of group. For example:

{{{
>>> esmre.hints(r"([0-3][0-9]/[0-1][0-9]/[1-2][0-9]{3})")
[]
}}}

This was done to simplify the hints function. I do plan to add better support 
for
groups soon.

Thanks for raising the issue.

Original comment by whar...@gmail.com on 1 Oct 2008 at 12:40

GoogleCodeExporter commented 9 years ago

Original comment by whar...@gmail.com on 1 Oct 2008 at 12:41

GoogleCodeExporter commented 9 years ago
Fixed in trunk@50.

Original comment by whar...@gmail.com on 1 Oct 2008 at 8:13

GoogleCodeExporter commented 9 years ago
Released in 0.3.0.

http://esmre.googlecode.com/files/esmre-0.3.0.tar.gz

Original comment by whar...@gmail.com on 1 Oct 2008 at 8:58