Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

regex - How do I replace a newline in Atom?

In Atom, If I activate regex mode on the search-and-replace tool, it can find newlines as , but when I try to replace them, they're still there.

Is there no way to replace a newline-spanning string in Atom?

question from:https://stackoverflow.com/questions/31400866/how-do-i-replace-a-newline-in-atom

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Looks like Atom matches newlines as but behaves inconsistently when replacing just the with nothing.

So newlines seem to match s+ and , and only "half" of the line-ending matches .

  • If you replace with a string, nothing happens to the line-ending, but the string is appended to the next line
  • If you replace with a string, nothing happens at all, but the cursor advances.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...