How to extract 3 integers from "v%d.%d.%d" string format? : <p>I'm trying to extract 3 numbers out of the semantic version string which has the following format: <code>"v%d.%d.%d"</code></p>

<p>Here's my example code:</p>

<pre><code>std::string myVersion = "v3.49.1";
int versionMajor, versionMinor, versionPatch;
getVersionInfo(myVersion, versionMajor, versionMinor, versionPatch);
std::cout &lt;&lt; versionMajor &lt;&lt; " " &lt;&lt; versionMinor &lt;&lt; " " &lt;&lt; versionPatch &lt;&lt; '\n';
</code></pre>

<p>The expected result:</p>

<pre><code>3 49 1
</code></pre>

<p>How can I design the function <code>getVersionInfo()</code>?</p>

<p>What would be the most elegant solution?</p>
