开发者

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

  1. Put cursor in front of first line
  2. Start recording
  3. Type a (
  4. Press down and left on your keyboard
  5. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜