Adjusted the regular expression to extract the where clause.