Fixed processing of Regex

Added documentation.