better regexp support and bugfixes