Pattern parser (continued)

Added tests cases to verify