Regex to return the line

Asked

Viewed 129 times

-1

Knowing that \n is a line break, have any do the reverse? I am using the Sublime as editor and my text is like this:

1,
2,
3,

Turn into:

1,2,3,

Is there any regex or other means to do so?

  • 1

    \n is not a regular expression, it is a normal character. If you want to remove the line break just remove this character.

  • @Woss will edit my question.

  • Well, have you read all my previous comment? If it is a character, just remove it.

  • I don’t understand the question.

  • You do not need regex: https://stackoverflow.com/q/13578705

  • @Woss did not understand this removing the n.

Show 1 more comment

1 answer

3


  1. Open "Find and Replace" (CTRL+H)
  2. Enable "Regular Expression" (in red)
  3. Type n+ (or s+ or n s+, depending on the case) in the "Find" field, clear the "Replace" field"
  4. "Replace all"

inserir a descrição da imagem aqui

  • Show.. Thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.