The set of packages and types that you may use in through-the-web scripts, TALES "python:" expressions, PFG overrides and PFG script adapters is limited to those available in Restricted Python. Restricted Python is deliberately very conservative in which modules and types it makes available.
You may expand the list with explicit "allow" declarations made in a Python package included in your egg list. A sample of such a package is available in the github collective, and includes several modules and types that I've found particularly useful in PloneFormGen, including re.
You will still not be able to "import re" in a TALES expression, but you will be able to use re in a TTW script, which may be used as a PFG validator.