JavaScript: how to use a regular expression to remove blank lines from a string?

Your pattern seems alright, you just need to include the multiline modifier m, so that ^ and $ match line beginnings and endings as well: /^\s*\n/gm Without the m, the anchors only match string-beginnings and endings. Note that you miss out on UNIX-style line endings (only \r). This would help in that case: /^\s*[\r\n]/gm Also … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)