Added preprocessing cases and fixed regular expressions.