MCPcopy Create free account
hub / github.com/avast/retdec / extractVersion

Function extractVersion

src/utils/string.cpp:1401–1411  ·  view source on GitHub ↗

* Search for version stored in input string * @param input Input string * @return Found version or empty string if no version found. * * A version is considered to be a substring which consisting of numbers * (and dots). If input string contains more versions, result contains only * the first one. */

Source from the content-addressed store, hash-verified

1399 * the first one.
1400 */
1401std::string extractVersion(const std::string& input)
1402{
1403 static std::regex e("([0-9]+\\.)+[0-9]+");
1404 std::smatch match;
1405 if (regex_search(input, match, e))
1406 {
1407 return match.str();
1408 }
1409
1410 return std::string();
1411}
1412
1413} // namespace utils
1414} // namespace retdec

Callers 5

parseGccCommentMethod · 0.85
parseGccProducerMethod · 0.85
parseClangProducerMethod · 0.85
parseTmsProducerMethod · 0.85
TEST_FFunction · 0.85

Calls 1

strMethod · 0.80

Tested by 1

TEST_FFunction · 0.68