public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified
@ 2014-11-17 17:49 kariya_mitsuru at hotmail dot com
  2014-11-18 18:57 ` [Bug libstdc++/63920] " kariya_mitsuru at hotmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kariya_mitsuru at hotmail dot com @ 2014-11-17 17:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63920

            Bug ID: 63920
           Summary: Any regular expression should not match an empty
                    sequence if match_not_null is specified
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kariya_mitsuru at hotmail dot com

Created attachment 34005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34005&action=edit
gcc -v

The sample code below should output "not match" but it outputs "match:1, 0" if
it is compiled by gcc 5.0.

====================================================================================================
#include <iostream>
#include <regex>

int main()
{
    std::cmatch m;
    auto result = std::regex_search("a", m, std::regex("b*"),
std::regex_constants::match_not_null);
    if (result) {
        std::cout << "match:" << m.position() << ", " << m.length() <<
std::endl;
    } else {
        std::cout << "not match" << std::endl;
    }
}
====================================================================================================
cf. http://melpon.org/wandbox/permlink/pTz5CBMMP4a6BU7f

According to C++11 standard 28.5.2[re.matchflag]/Table 139, "The expression
shall not match an empty sequence." if match_not_null is specified.


Note that the sample code of the Boost.regex version outputs "not match".
cf. http://melpon.org/wandbox/permlink/mfFqERCbt6qFf8HC


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-20 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 17:49 [Bug libstdc++/63920] New: Any regular expression should not match an empty sequence if match_not_null is specified kariya_mitsuru at hotmail dot com
2014-11-18 18:57 ` [Bug libstdc++/63920] " kariya_mitsuru at hotmail dot com
2014-11-25  5:43 ` timshen at gcc dot gnu.org
2015-02-06  7:04 ` timshen at gcc dot gnu.org
2023-07-20 11:35 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).