How do I join by new line

You need to use a double quote (“) instead of a single quote. So replace this: ‘\n’ with this: “\n” Read more about it here. You might want to use \r\n instead if you want your line-endings to be CRLF instead of LF (some Windows editors such as Notepad won’t see a LF linebreak).

Another way instead of escaping regex patterns?

Regexp.new(Regexp.quote(‘http://www.microsoft.com/’)) Regexp.quote simply escapes any characters that have special regexp meaning; it takes and returns a string. Note that . is also special. After quoting, you can append to the regexp as needed before passing to the constructor. A simple example: Regexp.new(Regexp.quote(‘http://www.microsoft.com/’) + ‘(.*)’) This adds a capturing group for the rest of the path.

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