You are here: PSPad forum > English discussion forum > Talk about regular expressions

Talk about regular expressions

Goto Page: 1 2 3 4 Next

#1 Talk about regular expressions

Posted by: maki | Date: 2020-02-03 23:49 | IP: IP Logged

image

Does not work on PSPad: Carriage Return

I want:

Find: \r
Replace with: abc

Quote:
[Window Title]
Info

[Content]
Occurrence of "\r" was found 0 times

[OK]

Edited 2 time(s). Last edit at 2020-02-03 23:55 by maki.

Options: Reply | Quote | Up ^


#2 Re: Talk about regular expressions

Posted by: pspad | Date: 2020-02-04 04:16 | IP: IP Logged

aswitch to HEX mode, replace and switch back

Options: Reply | Quote | Up ^


#3 Re: Talk about regular expressions

Posted by: maki | Date: 2020-02-04 17:01 | IP: IP Logged

I want to correct the expression to match:

website\.ru/(\d+)/(\d+)/(\d+)/(\d+)|website\.ru/(\d+)/(\d+)/(\d+-\d+)|website\.ru/avtor/[0-9a-z]$

website.ru/2020/03/87/1276

website.ru/2020/03/970-1276

website.ru/avtor/example1

website.ru/avtor/8765example10

Edited 2 time(s). Last edit at 2020-02-04 17:02 by maki.

Options: Reply | Quote | Up ^


#4 Re: Talk about regular expressions

Posted by: pspad | Date: 2020-02-04 18:14 | IP: IP Logged

You are near correct
add "+" char before the last "$"

Options: Reply | Quote | Up ^


#5 Re: Talk about regular expressions

Posted by: maki | Date: 2020-02-04 18:45 | IP: IP Logged

I would like to add at the end of the line, but it join the lines, which is wrong.

Regex: (\r\n|\r|\n)

Replace with: #.txt

website.com/example111/wxsx

website.com/example111/wxsx#.txt

Edited 3 time(s). Last edit at 2020-02-04 18:46 by maki.

Options: Reply | Quote | Up ^


#6 Re: Talk about regular expressions

Posted by: pspad | Date: 2020-02-04 19:37 | IP: IP Logged

You are looking for the line ends and replace it with *.txt

Options: Reply | Quote | Up ^


#7 Re: Talk about regular expressions

Posted by: maki | Date: 2020-02-04 20:02 | IP: IP Logged

Yes, but not *.txt only #.x

x -> any "operator" - not extension! but example #.txt

Edited 4 time(s). Last edit at 2020-02-04 20:05 by maki.

Options: Reply | Quote | Up ^


#8 Re: Talk about regular expressions

Posted by: maki | Date: 2020-02-05 16:30 | IP: IP Logged

How do separate lines by adding anything to the end of any character on each line?

Options: Reply | Quote | Up ^


#9 Re: Talk about regular expressions

Posted by: pspad | Date: 2020-02-05 16:40 | IP: IP Logged

serch for any existing char
replace with \n

Do it from the end of file with back direction

Edited 1 time(s). Last edit at 2020-02-05 16:40 by pspad.

Options: Reply | Quote | Up ^


#10 Re: Talk about regular expressions

Posted by: maki | Date: 2020-02-05 16:54 | IP: IP Logged

Not working.

image

Edited 1 time(s). Last edit at 2020-02-05 16:55 by maki.

Options: Reply | Quote | Up ^


Goto Page: 1 2 3 4 Next





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR