Lua has a number of libraries, collections of useful built-in functions, and you can read about them at Standard Libraries, which use many of the standard features found in other popular programming languages like PHP and Python, such as regular expressions and string handling functions. Because Lua can access libraries written in C, custom extensions can be implemented.
The Scribunto extension for MediaWiki provides a number of libraries specifically for use in MediaWiki and you can read about the common ones at Scribunto libraries. The library used to import Wikidata into other projects is documented at Extension:Wikibase Client/Lua.