NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Example for searching and replacing newlines wanted


Joined: 29 May 2010
Posts: 4
Location: Germany
Reply with quote
Hi all,

I'd like to know, how to insert newline chars in some code, using the search/replace dialog.

I've read, that it is possible via regex:
http://forum.nusphere.com/search-and-replace-special-characters-t4469.html
phpEd chm > Replace

Maybe, someone could supply a solution for this example:

Example
------------------------------------------------------
Insert a newline char after each ";" in the string "Foo;Bar;Baz;".
The result would obviously be
Foo;
Bar;
Baz;


First try
My input in the search/replace dialog
------------------------------------------------------
Text to find: ;
Replace with: ;\n
[x] Regular expressions
[x] Global scope

Result:
Foo;\nBar;\nBaz;\n


Second try
My input in the search/replace dialog
------------------------------------------------------
Text to find: ;
Replace with: ;\n
[ ] Regular expressions
[x] Global scope

Result:
Foo;\nBar;\nBaz;\n


No success so far.


These resources weren't helpful for me:
-----------------------------------------------------------
1. phpEd chm > Replace (No examples)
2. phpEd chm > Regular expressions (No examples)
3. http://forum.nusphere.com/search-and-replace-special-characters-t4469.html


PhpEd-Version:
-----------------------------------------------------------
5.9.5 (Build 5966) / Windows XP


Have a nice weekend!
Greetings from germany
uwe
View user's profileFind all posts by schmelzerSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Try this:

Check "Multiline search" checkbox, search dialog will switch to multiline mode.
Text to find: ;
Replace with: ;<enter>

Where <enter> mean that you should press <enter> key.
View user's profileFind all posts by mdegtyarevSend private message


Joined: 29 May 2010
Posts: 4
Location: Germany
Reply with quote
Hi mdegtyarev,

it works! Thanks a lot!
It's easy, obvious and intuitive Wink

Greetings from Southern Germany
uwe
View user's profileFind all posts by schmelzerSend private message
Example for searching and replacing newlines wanted
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic