title: How to get the stem of a filename from a path?
body: <p>I want to extract a const char* filename from a const char* filepath. I tried with regex but failed:</p>
  
  <pre><code>const char* currentLoadedFile = "D:\files\file.lua";
  char fileName[256];
  if (sscanf(currentLoadedFile, "%*[^\\]\\%[^.].lua", fileName)) {
  return (const char*)fileName; // WILL RETURN "D:\files\file!!
  }
  </code></pre>
  
  <p>The issue is that "D:\files\file" will be returned and not the wanted "file"(note: without ".lua")</p>