Is there match_partial in C ++ 11 Regular Expressions?

I read the n1429 section

The regex_match and regex_search algorithms support a function that is not commonly seen in regular expression libraries: partial matching . When the std::regex_constants::match_partial set in the flags passed to the algorithm, then true can be returned if one or more characters were matched and the state machine then reached the end of the character while the states are still saved. [...]

But I can not find any traces of this function in the FCD or in the headers of the current gcc-4.7.0. I also searched for revision n1429, but found nothing again. I know that the proposal was based on the fact that it arose in Boost and turned it into TR1. But I do not know when match_partial disappeared.

Is a partial match function still in C ++ 11? Maybe with a different name?

+6
source share
1 answer

It seems that the match_partial flag match_partial been removed in N1723 "Proposed Solutions for TR Library Problems" (2004 Oct) as Resolution N1507 "Correction to the Regular Expression Proposal" :

7.34 match_partial flag value

Remove match_partial.

The rationale for N1837 "Technical report on expanding the library " List of problems " is as follows:

The LWG agrees that this is a useful and implementable function, but we tried repeatedly and failed to give it an adequate specification. We hope that it will be possible to add this feature in a future version.

I assume there is no replacement in C ++ 11. You can still use Boost.Regex, though (from where std::regex comes from), which supports partial matching .

+8
source

Source: https://habr.com/ru/post/898882/


All Articles