Fixed bug in Issue #91. Changed the position of the function rtrim in method createRegexPatterns