Note that your line 221 has incorrect regex syntax. The "-" (dash) character needs to come at the end of the sequence, if you're going to allow it as a character within the match, as opposed to a metacharacter indicating a range.
Note that without this change, if you specify a hostname as your postgres database instance to connect to (e.g., an AWS RDS postgres database cluster), you will get back the error message "Invalid host".
Note that your line 221 has incorrect regex syntax. The "-" (dash) character needs to come at the end of the sequence, if you're going to allow it as a character within the match, as opposed to a metacharacter indicating a range.