Forever-Young / mrab-regex-hg

Automatically exported from code.google.com/p/mrab-regex-hg
0 stars 0 forks source link

regex.compile("a#comment\n*", flags=regex.X) causes "_regex_core.error: nothing to repeat" #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
>>> import regex
>>> regex.compile("a#comment\n*", flags=regex.X)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python32\3.2.2\lib\site-packages\regex.py", line 289, in compile
    return _compile(pattern, flags, kwargs)
  File "C:\Python32\3.2.2\lib\site-packages\regex.py", line 423, in _compile
    parsed = parse_pattern(source, info)
  File "C:\Python32\3.2.2\lib\site-packages\_regex_core.py", line 339, in parse_
pattern
    branches = [parse_sequence(source, info)]
  File "C:\Python32\3.2.2\lib\site-packages\_regex_core.py", line 358, in parse_
sequence
    item = parse_item(source, info)
  File "C:\Python32\3.2.2\lib\site-packages\_regex_core.py", line 368, in parse_
item
    element = parse_element(source, info)
  File "C:\Python32\3.2.2\lib\site-packages\_regex_core.py", line 709, in parse_
element
    raise error("nothing to repeat")
_regex_core.error: nothing to repeat
>>>

What is the expected output? What do you see instead?
>>> import regex
>>> regex.compile("a#comment\n*", flags=regex.X)
regex.Regex('a#comment\n*', flags=regex.X | regex.V0)
>>> regex.search("a#comment\n*", "aaa", flags=regex.X).group(0)
'aaa'
>>>

What version of the product are you using? On what operating system?
Windows XP Home SP3 (32-bit version)
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
regex 0.1.20120122

Please provide any additional information below.

Original issue reported on code.google.com by msm...@gmail.com on 22 Jan 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Fixed in regex 0.1.20120123.

Original comment by re...@mrabarnett.plus.com on 23 Jan 2012 at 12:01