I think I may have found a bug in py regex, or have I made an error?
import regex
...
iters = regex.finditer("Teams? [^u]*? rejected",file)
for Result in iters:
Beginning = Result.span()[0]
End = Result.span()[1]
Text = Result.match()
Running the above code gives the following result/error. It clearly outputs the regex.Match object with the match attribute then gives an error that the object has no attribute match.
<regex.Match object; span=(7684, 7708), match='Teams 1, 2 and 7 are rejected'>
Traceback (most recent call last):
File "b.py", line 72, in <module>
Text = Result.match()
AttributeError: '_regex.Match' object has no attribute 'match'
I wrote this code awhile ago on a different computer and it worked. Now on my new computer it gives this error. Not sure what my previous version of regex was, this is my current version.
>>pip show regex
Name: regex
Version: 2017.2.8
Summary: Alternative regular expression module, to replace re.
Home-page: https://bitbucket.org/mrabarnett/mrab-regex
Author: Matthew Barnett
Author-email: [email protected]
License: Python Software Foundation License
re, notregex.