The clang-extdef-mapping tool can only output the real file name of the input source file. When analyzing with AST file based CTU analysis, the file name should be adjusted to the corresponding AST file, where .ast will be appended to the file name, and sometimes the path will even be changed. It is very inconvenient to adjust the file path with such a separated step, especially on Windows, where utility tools such as sed are not available.
This patch uses Regex::sub function to adjust the output file name for each index entry with the pattern provided by the user.