Boost Users :
From: Eko palypse (ekopalypse_at_[hidden])
Date: 2020-01-24 16:04:53
Hopefully I'm not posting this again.
Hello, I'm wrapping boost::regex with cython to be able to call it from
Assuming a "Hello World" text and a regex (\w+)*.
This results in two matches.
groups ('Hello', 'Hello')
groups ('', '')
I understand, that there is always the main match in group0 and matches from
capturing groups in group1 ...
As we see, the second match, the zero-length-width match, reports two
groups but the second group returns -1.
Is it possible to prevent such matches to be reported beforehand?
Or is it needed to iterate over the groups to eliminate those?
Just in case it is needed to see my code logic, this is what I'm doing
def unicode_research_iter(const wchar_t* text, wchar_t* pattern, int flags):
wcregex_iterator start, end
start = make_regex_iterator(text, <wregex>pattern,
end = wcregex_iterator()
while (start != end):
what = <wcmatch>deref(start)
if not what.empty():
match_object = UnicodeMatch.from_instance(what)
print('Empty match result: ??')
inc(start) # increment
except Exception as e:
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net