Function for compare the modules
Search in reverse order
Optionalhint: string | RegExpOptional name-token or regex to narrow the candidate set (e.g. "MsgCollection" or /^WAWebMsg/). When provided, matching modules are tried first; on miss we fall back to a full scan.
Return the module id from a search function