Brackets: Regex replace with New-line (\n) or Tab (\t)

Created on 10 Jun 2014  Â·  62Comments  Â·  Source: adobe/brackets

Cannot _regex replace_ with new-line (\n) or tab (\t).

Example:

Apple, Orange, Melon

Search: ,
Replace with: \n\t$&

medium priority

Most helpful comment

Can I ask why it's so difficult to get this issue fixed?

All 62 comments

Reviewed medium priority to me.

additionally, brackets says \n can not be found.

trying to replace line breaks with empty space
Search: '\n'
Replace with: ' '
image

The 2nd issue listed by @fibric is a duplicate of 'Find/Replace: Allow matching across newlines (\n or multiline regex) on Brackets' on our feature backlog. See the workaround there for how to include newlines in your search _query_.

There's no easy way to include newlines (or \t) in your _replacement text_, though (@gmaggio's original bug report). That would actually be simpler to fix, so it makes sense to leave this bug open to track that half.

@peterflynn thx for noting!

Has there been any more work on this issue? I'm trying to choose an editor for my students to use and the ability to search/replace across multiple lines is a make-or-break deal for me. Any workarounds?

@brentonstrine brackets still can't do that. try atom or sublime text instead.

@fibric I actually came to Brackets because sublime was too expensive for students and Atom is too buggy (I get error messages and crashes constantly). The search/replace functionality on Atom is not very good right now, but it's better than Brackets at this point. It seems pretty inexcusable for a text editor to have terrible search/replace when it comes to multiple lines or multiple files.

@brentonstrine http://limetext.org/

Cool looking project, definitely not ready for beginners yet though. I'll follow it with interest, thanks.

+1

Any updates ?

I need to replace a deliminator with a line break! lets get this going!

+1

+1

+1

+1

+1

"grep" it is

+1

+1

+1

+1

+1

+1

+1 !!!!!

It's funny that @mqklin is downvoting every commenter without providing any argument...

I'm going to lock this discussion soon if there will be more +1 comments.
They add only noise and they create notifications for all people subscribed to this issue.
Please, use the github reactions on the first comment.

@mqklin I added my +1 comment at a time when GitHub did not have reactions on comments. Then they added reactions, and I gave my thumbs-up too. Your thumbs-down is unnecessary.

@ficristo I think an update or discussion of the feature would be warranted, this has been sitting around for a long time and it's a pretty basic feature in a lot of editors.

@awwright I totally agree this is a foundamental feature.
As I mentioned before, https://github.com/adobe/brackets/pull/11614 should fix this issue, but I think having https://github.com/adobe/brackets/pull/13152 would make more sense.
I don't know the status of that nor what are, in general, the priorities of Adobe.
The only advice I can really give you is to switch to another editor. Personally, for the little I used, I like VSCode.

@valioDOTch

It's funny that @mqklin is downvoting every commenter without providing any argument...

That's incurable

As for \n \t \r like search/replace/find, in Nodepad++, neither VCode, nor Brackets, and Sublime could beat it.

The other important feature that makes me stay with Notepad++ is that it can batch replace either simple, or \n\t\r etc, or regexp in chosen folder and extension.

So have to launch Brackets for its formatting feature, though it's ugly that it needs file extension.
And Vcode just to see what's new, but F1 commands make me stay away from it. I prefer touching keyboard only for typing text, and mouse for all commands.

How can they call it self a code editor if these simple commands \n \r \ t and many others dont work or are not available in search/find/replace???

I have been using TextPad & Notepad++ for a long time and I think it should be a basic feature for a powerful editor. This thread is started in 2014 and still in 2017, it's not supported. :(

+1

I gave Brackets a fair shot but the lack of this feature is unbearable. Back to sublime I guess.

I agree with @gregmcinnes
Brackets is unsuitable for any experienced developer.
Just move on to something else.
Unsubscribing from this 3 year old thread.

Can I ask why it's so difficult to get this issue fixed?

Nothing happened with this bug? I need to search another editor. Sorry Brackets!

Looks like project out of supporting. What a shame, for this program alternative only 'sed'.

Uninstall('Brackets');

Seriously guys? This still isn't fixed?

Using VSCode now. Sorry Brackets devs, you royally fucked up. Even though you're backed by a huge software maker.

Changing to Sublime text - issue is almost freaking 5 years old

Are you kidding me? This is a 5 year old unresolved issue?

This is pretty basic. Leaving Brackets for an editor that works better.....

I also uninstalled brackets on mac, I installed VS Code instead. You can replace with /n with regex search.
In windows I used to use NotePad++, but VS Code is superior to everything and open source/free.

how in the world is this still an outstanding issue?

5 years now, wow

This is a serious request for Mac users which are working with larger text files for formating/parsing

Bye bye brackets

It should be noted that escapable chars in general should be considered where possible (like \r or rarer chars).
maybe a backslash should always be interpreted as start of an escape in the replacement field, too, not just the search field.
Because consistency is good.
And here's hoping something is going to happen at all. 🤞

Welcome to 2020. I was loving this over Sublime Text until I tried to do a mass replace for line breaks... How is this not a thing?!

Moving from Brackets back to Visual Studio Code... This issue is 6 years old.
Literally Notepad++ has this feature but, Brackets, advanced web development source editor by Adobe does not... Sad

I really loved Brackets.. had to uninstall this just because this feature is not present :(

I tried Brackets because it was recommended as an alternative to Notepad++ on the Mac, specifically because I needed to find and replace a string with an added newline. Brackets is not an alternative to Notepad++ without this feature. I am uninstalling Brackets now. Installing it was a waste of time. Sorry to go.

There is a really easy way to do this in Brackets that I don't see mentioned here. Use "Find and select" in the "Find" menu to find whatever your delimiter is. Then you'll have all of them selected at once, so just press enter to replace them all with a newline. Then just press escape to exit multi-cursor mode and go back to normal editing.

@pabrown1975... Yes, that will work in that one specific instance. But the lacking functionality that the rest of us are complaining about is that a newline '\n' cannot be included as part of the 'Find' string. I need to match a string including a newline and replace it with a string that may or may not also include a newline, like I could in Notepad++ in Windows. I have moved on to Sublime Text on the Mac. Works fine.

Seems related to https://github.com/adobe/brackets/issues/5499

Strange how you cannot replace the text "\n" or "\n\t" with actual carriage returns or tab characters.

After 6 years, please, change this issue to high priority.
I my opinion a must have and deal breaker functionality.
Meanwhile any other code-editor included this basic feature.

6 long years, and this issue is still lying there..
Unbelievable !!
This is definitly a deal breaker for me. Need to find an alternative to Brackets now..

I recommend the editor with the name "sublime"

On Wed, Nov 4, 2020, 10:48 PM raghubedi2004 notifications@github.com
wrote:

6 long years, and this issue is still lying there..
Unbelievable !!
This is definitly a deal breaker for me. Need to find an alternative to
Brackets now..

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/adobe/brackets/issues/8093#issuecomment-722139134,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABOBXGBVKU5DMY2FCOESRKDSOIVCJANCNFSM4AQKTIRQ
.

This issue still exists now in 2021.

It is impossible to use a regex replacement and have the replace be a newline, as given in the example at the top of this thread.

Is there a particular reason this issue is difficult to tackle? Why would a newline be different from any other character in a text file?

Was this page helpful?
0 / 5 - 0 ratings