Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Regex replace with New-line (\n) or Tab (\t) #8093

Open
gmaggio opened this issue Jun 10, 2014 · 64 comments
Open

Regex replace with New-line (\n) or Tab (\t) #8093

gmaggio opened this issue Jun 10, 2014 · 64 comments

Comments

@gmaggio
Copy link

gmaggio commented Jun 10, 2014

Cannot regex replace with new-line (\n) or tab (\t).

Example:

Apple, Orange, Melon

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

@dangoor
Copy link
Contributor

dangoor commented Jun 17, 2014

Reviewed medium priority to me.

@ghost
Copy link

ghost commented Nov 10, 2014

additionally, brackets says \n can not be found.

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

@peterflynn
Copy link
Member

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.

@ghost
Copy link

ghost commented Dec 5, 2014

@peterflynn thx for noting!

@brentonstrine
Copy link

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?

@ghost
Copy link

ghost commented Mar 29, 2015

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

@brentonstrine
Copy link

@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.

@ghost
Copy link

ghost commented Mar 29, 2015

@brentonstrine
Copy link

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

@awwright
Copy link

+1

@ficristo
Copy link
Collaborator

There is a PR #11614

@nitinsurana
Copy link

Any updates ?

@johnbenac
Copy link

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

@hiredgunhouse
Copy link

+1

2 similar comments
@m0grochowski
Copy link

+1

@ghost
Copy link

ghost commented Sep 9, 2016

+1

@zaggino zaggino added this to the Release 1.9 milestone Sep 9, 2016
@zatnekitel
Copy link

+1

1 similar comment
@rodya-mirov
Copy link

+1

@allmyne
Copy link

allmyne commented Nov 10, 2016

"grep" it is

@smrnv
Copy link

smrnv commented Dec 12, 2016

+1

3 similar comments
@brubraz
Copy link

brubraz commented Jan 5, 2017

+1

@valioDOTch
Copy link

+1

@SachinNambiar
Copy link

+1

@thany
Copy link

thany commented Jan 4, 2018

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

@florindediu
Copy link

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

@ghost
Copy link

ghost commented May 9, 2018

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

@ksaveras
Copy link

Uninstall('Brackets');

@thebrucecgit
Copy link

Seriously guys? This still isn't fixed?

@thany
Copy link

thany commented Jan 18, 2019

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

@thebrucecgit
Copy link

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

@ghost
Copy link

ghost commented Jan 26, 2019

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

@RickFanta-Cable
Copy link

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

@ghost
Copy link

ghost commented Feb 6, 2019

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.

@hotdishtoby
Copy link

how in the world is this still an outstanding issue?

@Elvis10ten
Copy link

5 years now, wow

@cgi1
Copy link

cgi1 commented Apr 2, 2019

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

@mjy78
Copy link

mjy78 commented May 15, 2019

Bye bye brackets

@Black-Platypus
Copy link

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. 🤞

@StormMagnus
Copy link

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?!

@alekexe
Copy link

alekexe commented Feb 17, 2020

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

@ghost
Copy link

ghost commented Apr 9, 2020

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

@MrNewick
Copy link

MrNewick commented May 3, 2020

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.

@pabrown1975
Copy link

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.

@MrNewick
Copy link

@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.

@jediwompa
Copy link

Seems related to #5499

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

@cnleo
Copy link

cnleo commented Aug 4, 2020

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.

@raghubedi2004
Copy link

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..

@johnbenac
Copy link

johnbenac commented Nov 5, 2020 via email

@bismurphy
Copy link

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?

@nrshapiro
Copy link

Sad to see this limitation :(

@vjtomas
Copy link

vjtomas commented Jul 5, 2021

On September 1, 2021, Adobe will end support for Brackets. If you would like to continue using, maintaining, and improving Brackets, you may fork the project on GitHub. Through Adobe’s partnership with Microsoft, we encourage users to migrate to Visual Studio Code, Microsoft’s free code editor built on open source. (http://brackets.io/)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests