* 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. */
| 1399 | * the first one. |
| 1400 | */ |
| 1401 | std::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 |