avoid function calls in pattern escaping
documented some functions from base library