Expose tags validation regex or function

I want to have the ability to check if a user input is a valid tag, to avoid a inconsistent tag on my UI with the actual tag that Obsidian accepts.

I’m currently building my own based on the help doc. Tags - Obsidian Help But it would be more convenient and be easier to keep updated with the newest rule if we could call API function for this.