Opened 11 years ago

Closed 11 years ago

#5852 closed Bugs (invalid)

boost::xpressive::sregex::compile

Reported by: anonymous Owned by: Eric Niebler
Milestone: Boost 1.48.0 Component: xpressive
Version: Boost 1.47.0 Severity: Problem
Keywords: smatch compile Cc: ivandiprima@…

Description

Hi,

please run very simple program attached and see why it doesnt match result in one instance while it correctly does in the other instance (commented out).

Thanks Ivan

Attachments (2)

Makefile (281 bytes ) - added by anonymous 11 years ago.
Aksel.cpp (1.1 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (3)

by anonymous, 11 years ago

Attachment: Makefile added

by anonymous, 11 years ago

Attachment: Aksel.cpp added

comment:1 by Eric Niebler, 11 years ago

Resolution: invalid
Status: newclosed

You are using the wrong algorithm. regex_match only succeeds if it consumes the whole input, which the first pattern does. regex_search will find the pattern anywhere in the input string. You should use regex_search. (And read the docs. ;-))

Note: See TracTickets for help on using tickets.