Notepad ++ Replace All Regular Expression (Start of the line and End of the line)
I am tryin to Replace the start of line with a "(". However when i use replace all i'm not able to do so.
For eg:
432425\n
4254645\n
w4546746\n
46457367\n
4765756\n
I want the output as using Replace All So i use 开发者_如何转开发the ^ symbol with Regular Expression Selected and Replace All.
Using only Replace works fine.
(432425\n
(4254645\n
(w4546746\n
(46457367\n
(4765756\n
Not a solution, but a workaround:
Instead of using Regex's you can use the notepad++ macro feature to record keystrokes and then replay until the end of the file...
- Put cursor in front of first line
- Start recording
- Type a (
- Press down and left on your keyboard
- End recording
Replay to end of file
Easier if you don't know Regex's.
A workaround: find ^(.)
and replace with (\1
.
It seems like a Notepad++ bug to me.
I don't know why you are having problems.
This works for me in Notepad++ v6.2:
Search -> Replace
Search Mode -> Regular expression
Find What: ^
Replace with: \(
Click Replace All
If you are using notepad++, don't bother with the regex.
Instead, use the extended search mode to replace all \n with (
I do not have the rep points to add a comment...
@MrBones
replacing "\n" also needs "\n" as the beginning of the "replace with" so that the file still has \n instead of only "\r".
so for Notepad++
Find what:\n Replace with:\n(
This will work in Notepad++ : before doing replace steps, first copy text to notepad, then copy text from notepad to notepad++,
Search -> Replace Search Mode -> Regular expression Find What: ^ Replace with: ( Click Replace All
if you mean replace same as insert (
on start of the line,
just using this following easy step:
Type:
^
in "Find what" box.
(
in "Replace with" box.
Hints:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Editing_Configuration_Files
精彩评论