You are here: PSPad forum > English discussion forum > Talk about regular expressions
Goto Page: Previous1 2 3 4 Next
Posted by: pspad | Date: 2020-02-05 17:06 | IP: IP Logged
Read my answer again
You wrote you want to find something and replace it with new line, right?
So you are looking for new line and you replaces it with anything. Strange...
Maybe you don't know what are you doing, maybe don't know what do you want to do.
Write your answer agin like this:
I have line: xxxxxxxx
I want to have line: yyyyyyyyyy
So I need to replace xxx with yyy
Or I want to add on the end of the line: zzzz
Edited 1 time(s). Last edit at 2020-02-05 17:07 by pspad.
Posted by: maki | Date: 2020-02-05 17:25 | IP: IP Logged
I want insert text into lines: at lines end
I want to use regex
Find: (.)$
Replace: \1\\n
Hm?
Edited 1 time(s). Last edit at 2020-02-05 17:30 by maki.
Posted by: pspad | Date: 2020-02-05 17:36 | IP: IP Logged
Do you want to add text on the end of line + add another line end ?
Posted by: maki | Date: 2020-02-05 17:39 | IP: IP Logged
Example. I have URL(links) on each line and want to insert #.test at the end of each URL.
Simple and understandable?
Posted by: pspad | Date: 2020-02-05 17:44 | IP: IP Logged
Finally yes. Why don't you write it in your question?
What is written when you click on '?' button for the end of the line?
Search: $
Replace: #.test
Posted by: maki | Date: 2020-02-05 18:47 | IP: IP Logged
If $ sign is at the end of a regular expression, the matched string must be at the end of the string being find.
Do you know such a little-known alternative?
Search: \Z
Replace: #.test
Thanks. Working.
Edited 1 time(s). Last edit at 2020-02-05 18:48 by maki.
Posted by: pspad | Date: 2020-02-05 18:58 | IP: IP Logged
Show real examples if you want real answer
Posted by: maki | Date: 2020-02-05 19:11 | IP: IP Logged
But how do I want to ignore whitespace???
\s*$
Example:
Line1:172349 0
Line2:12345
Replace with:
Line1:172349#.test
Line2:12345#.test
Posted by: pspad | Date: 2020-02-05 19:23 | IP: IP Logged
Sample:
172349 0
12345
search: ^(\d+).*
replace: $1#.test
Posted by: maki | Date: 2020-02-05 19:40 | IP: IP Logged
What search type if it is any url (sample)?
Edited 2 time(s). Last edit at 2020-02-05 19:41 by maki.
Editor PSPad - freeware editor, © 2001 - 2025 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR