Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11776: Effective way to find all regex matches in large file (was: Need way to find all regex matches in large file)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-03-15 17:06:50
#11776: Effective way to find all regex matches in large file
-------------------------------+--------------------------
Reporter: der-storch-85@⦠| Owner: johnmaddock
Type: Feature Requests | Status: reopened
Milestone: To Be Determined | Component: regex
Version: Boost 1.59.0 | Severity: Optimization
Resolution: | Keywords:
-------------------------------+--------------------------
Changes (by der-storch-85@â¦):
* status: closed => reopened
* resolution: wontfix =>
Comment:
Replying to [comment:1 johnmaddock]:
> Documentation updated.
Great. But, as I wrote, an additional update of
[http://www.boost.org/doc/libs/1_59_0/libs/regex/doc/html/boost_regex/partial_matches.html
Partial Matches] is really necessary, because itâs one of the first
answers when searching a solution for this special problem. For a
(tortuous) workaround see attached file `main.cpp` that can be compiled
with
{{{
g++ main.cpp -std=c++11 -lboost_regex -o regex
}}}
> Note that this particular case can be detected by checking whether the
end of the match is at the end of the current string.
In the ''above very particular'' case: yes, but normally: no. That would
be to easy ;-)
Example: buffer size 4, regex "(ab)+", and input 1abab2.
> However, there are expression such as "abc.*123" that actually need the
whole input string (no matter how long it may be) to determine the longest
match.
Correct, you have to keep that in mind, especially when parsing large
files. Nevertheless: Erroneous or senseless regexes lead to unwanted or
erroneous program executions.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11776#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC