Indeed. Parsing used units (including those mentioned in includes) is like parsing a language.
Since regular expressions are not Turing complete this is not even possible.
There are tools, however, that will resolve each and every unit used, based on a Pascal parser.