Updated the regex to allow empty strings
The previous version caused an emtpy string to be considered an incorrect break point, meaning parts of the query were left unmodified