Split on different newlines April 19, 2023 by Tarik Did you try /\r?\n/ ? The ? makes the \r optional. Example usage: http://rubular.com/r/1ZuihD0YfF