Notepad++ using find-replace function without reg. expressions??

nanquan491

New member
Local time
1:19 AM
Messages
13
I'm hoping to get lucky with this post since the forums on the official Notepad++ website are very slow to respond, and maybe someone on here uses NPP and knows the answer.

Say I want to find a certain block of code that spans across multiple lines, and replace it with another block of code which spans across multiple lines as well.

From what I understand, this is possible, but you have to use regular expressions, which means taking both blocks of code, and manually editing them to replace all the line breaks with regular expressions, so that they could fit into the single line input of the find-replace function.

Needless to say this is very tedious and time consuming!!

Is there any way that I can just select and copy-paste a block of code spanning across multiple lines, then replace it with another one which I copy-pasted as well, without having to manually edit them to replace line breaks with regular expressions??

This was possible in CuteHTML which I was using before making the switch to Notepad++. I'm not sorry that I did as Notepad++ is far superior, but that is the only feature from CuteHTML that I miss, the ease with which you could find-replace large blocks of code just by copy pasting them.

Any help will be greatly appreciated!

Thanks for reading!
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
Seems pretty straight forward to me. Use "extended" mode for searching, copy the line in that you want replaced, replace the line breaks with "\r\n", then put the text in you want it replaced with and do the same.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
Seems pretty straight forward to me. Use "extended" mode for searching, copy the line in that you want replaced, replace the line breaks with "\r\n", then put the text in you want it replaced with and do the same.
Dude, this is exactly what I want to avoid doing... haven't you read my message?
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
If you could do it the way you want to, you would be able to. And as you've found out, you cannot. I don't get how adding "\r\n" to a line of text is tedious and time consuming when it will do exactly what you need done. Clearly time consumption isn't an issue as you're spending all this time of various forums trying to find a way around something you could instead just be doing and already getting done. Good luck.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
If you could do it the way you want to, you would be able to. And as you've found out, you cannot. I don't get how adding "\r\n" to a line of text is tedious and time consuming when it will do exactly what you need done. Clearly time consumption isn't an issue as you're spending all this time of various forums trying to find a way around something you could instead just be doing and already getting done. Good luck.
You don't understand how simply copying-pasting a block of code without having to manually replace all the line breaks and adding reg. expressions is easier and less time consuming? :shock:

As for time not being an issue because I'm spending it on various forums trying to see if there's a solution to my problem, I'm actually faced with this problem a lot and so if I get a solution for it once and for all it'll save me a lot of time and effort in the future, so I figured I'd try.

Anyway I've never understood people like you who instead of answering the question, are stating the obvious, and then trying to convince someone they were "wrong" to ask the question in the first place.

Thanks for your opinion, but I'm looking for an answer to my question, not for people telling me I shouldn't have a problem with the thing I'm having a problem with in the first place.
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
I answered your question in my first two sentences. You can't do it the way you want to. You've already realized this. And, to follow up, I even told you exactly how you could achieve what you wanted to do. So, I'm not sure what else you're looking for. You not wanting to do something doesn't invalid the answer to a question. If you're looking to keep asking a question until you find an answer you want rather than the actual answer, this may not be the forum for you.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
I answered your question in my first two sentences. You can't do it the way you want to. You've already realized this. And, to follow up, I even told you exactly how you could achieve what you wanted to do. So, I'm not sure what else you're looking for. You not wanting to do something doesn't invalid the answer to a question. If you're looking to keep asking a question until you find an answer you want rather than the actual answer, this may not be the forum for you.
Actually Notepad++ is a pretty extensive program, many features of which I am not familiar with and don't know anything about. That's why I thought I'd ask hoping that people who are more knowledgeable than me would be able to tell me if there's an option to do what I want that I am not aware of.

You answered by saying "If you could do it the way you want to, you would be able to.", which is a hypothetical and inconclusive statement. Rather if you'd known 100% that this wasn't possible I would expect you to write something along the lines of "There is no way to do this in Notepad++, I am an expert on the program and I can say this with 100% certainty!".

Instead you chose to be a smartass about it, by saying it that way, and then proceeding to lecture me that I shouldn't have a problem with the issue I'm having a problem with in the first place. And now you're trying to be a smartass again by basically telling me "I told you so".

Your attitude is that of a very condescending and irritating individual. I don't know if this is on purpose due to some real life frustrations you have, or you don't even realize you're doing this (e.g. Asperger syndrome), and this whole message of mine will now come as a complete shock to you. In any case it's surprising to me how someone with your attitude is actually a "senior member" here on the forums.

Thanks for the great help and your "wonderful" attitude.
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
None of my answers were hypothetical, so I'm not sure you understand what that means. I'm not an expert in Notepad++ and you don't need to be to provide an answer to your question. You have an obvious problem you need to solve and Notepadd++, because it's an excellent editor, provides the means to do it. Now, for whatever reasons, you're so vehemently opposed to the answer it provides that you're instead trying to spend time attacking the person who is providing you the answer to this several times. If you want to get into psych evaluations of people, you need to understand what psychological projection is before you start accusing others of what you think they are doing. But, this is SevenForums, not PsychForums. You've been provided the answer twice now and it's obvious you have a problem with its reality. I apologize if somehow me answering your questions has offended you, and I don't want to turn you off to this great forum. But, based on your attitude thus far, it sounds like you're looking for a place someone might tell you what you want to hear rather than provide you with an answer.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
None of my answers were hypothetical, so I'm not sure you understand what that means. I'm not an expert in Notepad++ and you don't need to be to provide an answer to your question. You have an obvious problem you need to solve and Notepadd++, because it's an excellent editor, provides the means to do it. Now, for whatever reasons, you're so vehemently opposed to the answer it provides that you're instead trying to spend time attacking the person who is providing you the answer to this several times. If you want to get into psych evaluations of people, you need to understand what psychological projection is before you start accusing others of what you think they are doing. But, this is SevenForums, not PsychForums. You've been provided the answer twice now and it's obvious you have a problem with its reality. I would suggest you find another place where someone might tell you what you want to hear rather than provide you with an answer.
You provided no answer to my dilemma what so ever. If admittedly you're not an expert on Notepad++, then there might be a way to do what I want which you just don't know about, simple as that.

You telling me with a condescending attitude what I already know and then proceeding to lecture me that I shouldn't have a problem with it is not helpful in the slightest.

You seem to be completely lacking a sense of self awareness.

Anyway this is getting quite ridiculous. I didn't come to this forum to start a flame war with people who have personality problems. I came here to get help with my issue.

Is there anyone here who IS an expert on Notepad++ that can confirm with absolute certainty that what I'm looking to achieve is impossible?

Thanks!
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
You provided no answer to my dilemma what so ever.

From your original post:

nanquan491 said:
Is there any way that I can just select and copy-paste a block of code spanning across multiple lines, then replace it with another one which I copy-pasted as well, without having to manually edit them to replace line breaks with regular expressions??

My second reply:

FliGi7 said:
If you could do it the way you want to, you would be able to. And as you've found out, you cannot.

My third reply:

FliGi7 said:
You can't do it the way you want to.

Believe it or not (which seems to be the case), those are answers to your question. Another answer is to use regular expressions, as stated in my first post, which have been specifically created for these sorts of situations. Yet another answer is to go back to your CuteHTML editor that you know already does this. So you not only have two direct answers to your question on whether or not you can do what you're looking to do in Notepad++, but you also have two possible solutions to achieve your copy/replace problem.

You're confusing the difference between an answer, of which 2 have been provided, and a solution to your liking. No one can blame you for looking for a solution to your liking, but to say no answers have been provided is simply not reality.

Maybe someone else can come up with another solution that you may find suitable, but I obviously cannot. I hope you get it sorted out.
 

My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
If you insist on dragging this on...
nanquan491 said:
From what I understand, this is possible, but you have to use regular expressions, which means taking both blocks of code, and manually editing them to replace all the line breaks with regular expressions, so that they could fit into the single line input of the find-replace function.
Meaning that I already knew about the use of regular expressions, hence you stated the obvious and provided me with no new information.

FliGi7 said:
Believe it or not (which seems to be the case), those are answers to your question. Another answer is to use regular expressions, as stated in my first post, which have been specifically created for these sorts of situations. Yet another answer is to go back to your CuteHTML editor that you know already does this. So you not only have two direct answers to your question on whether or not you can do what you're looking to do in Notepad++, but you also have two possible solutions to achieve your copy/replace problem.
Again, that's stating the obvious and not helpful in the slightest. I already stated in my original post that I knew about the use of reg. expressions (I even stated this in the title of the post). Also as for going back to CuteHTML it is an outdated program no longer supported and doubtfully that it will work correctly on Win7, so that's not an option. If it were I would have used it already. Yes, I didn't state that in the original post since I expected people to assume that there was a reason I didn't and instead posted a forum question about this issue.

I guess you really think people are incredibly stupid and that you feel the need to state the obvious to them otherwise they will never figure it out without your help. You really should revise your outlook on life.

As I said, I need someone who knows the program inside-and-out to tell me for a fact that there are no features about it that I may not know of which do enable this functionality. Maybe even a 3rd party plugin of some sort.

If you don't know of a way to do what I want, then join the club, I don't know of it either. That's why I asked for answers from someone who does. You yourself said you were not an expert on Notepad++ and so if you do not know definitively and with 100% certainty that this cannot be done, then reiterating what I already know about regular expressions is not helpful. Thanks.
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
Assuming a default install of NP++ what you want is CTRL+R instead of CTRL+H

That corresponds to TextFX -> TextFX Quick -> Find/Replace

Explaining the ins-and-outs of TextFX find/replace is beyond the scope of this reply. Play with it. It will do everything you could possibly want.

You'll probably want to select the WRAP checkbox as a start point for your use case.
 

My Computer

Computer Manufacturer/Model Number
AOpen MP45
OS
Windows 7 Pro x86
CPU
T6600 @ 0.975V
Motherboard
i45GMx-I
Memory
4GB DDRII-800
Graphics Card(s)
Onboard Intel 4500mhd
Sound Card
Onboard Realtek + SteelSeries USB
Monitor(s) Displays
Asus ProArt 246
Screen Resolution
1920x1200
Hard Drives
Seagate Momentus XT 750
Keyboard
Cherry G230
Mouse
MS Wireless 3500
Assuming a default install of NP++ what you want is CTRL+R instead of CTRL+H

That corresponds to TextFX -> TextFX Quick -> Find/Replace

Explaining the ins-and-outs of TextFX find/replace is beyond the scope of this reply. Play with it. It will do everything you could possibly want.

You'll probably want to select the WRAP checkbox as a start point for your use case.
Thanks man! :) I'll definitely try that out...
 

My Computer

OS
Windows 7 Ultimate x64 (SP1)
CPU
Core i5 @ 4GHz
Graphics Card(s)
GTX 580
Screen Resolution
1080x1050
Hard Drives
Vertex 3 120GB SSD
Back
Top