You are here: PSPad forum > English discussion forum > Need help on Replacement Expression

Need help on Replacement Expression

Goto Page: Previous1 2 3 Next

#11 Re: Need help on Replacement Expression

Posted by: pspad | Date: 2020-03-31 15:11 | IP: IP Logged

I repeat:
You got simple example how to use substitution. Apply it for your expression.
It means enclose part of your expression with () and use substitution $1 $2 ...

If you need help, write here your current expression + real examples + results you want.
Cause till now I don't need what do you need.

Options: Reply | Quote | Up ^


#12 Re: Need help on Replacement Expression

Posted by: maki | Date: 2020-03-31 16:03 | IP: IP Logged

I have already given urls on this forum many times, and nothing has changed in this direction. Why do you ask for the url all the time?

Use original URL for file name = Filename.HTML

URL:
forum.pspad.com

Filename: 2,73181,73193#msg-73193

Edited 3 time(s). Last edit at 2020-03-31 16:06 by maki.

Options: Reply | Quote | Up ^


#13 Re: Need help on Replacement Expression

Posted by: pspad | Date: 2020-03-31 16:23 | IP: IP Logged

Everybody has time to search in tje forum past and guess what url you are talking in thousands of your questions.
You are the one who is asking help in this new topic you are the one who must provide all necessary information here.

Another wadte time

Options: Reply | Quote | Up ^


#14 Re: Need help on Replacement Expression

Posted by: maki | Date: 2020-03-31 18:36 | IP: IP Logged

I gave you a regular expression valid Match, I gave you a few url addresses and I gave result, but you are still asking something.

Options: Reply | Quote | Up ^


#15 Re: Need help on Replacement Expression

Posted by: pspad | Date: 2020-03-31 18:45 | IP: IP Logged

Learn first, how to write request.
when you will know it, maybe you will get answer.
Sorry, I don't have time to read 2 pages of nonsenses, read some older thertad where you gave some urls.

Next time. Put all information into your request topic and maybe you will get answer.
Yes, "maybe" is correct, cause this forum and PSpad both are for free, people answer here in their free time.

P.S. I was stupid again when I try to help you. Next time I won't react any your request what has no solution without thousands of question.
Please note, that no one is able to read your mind.
Try it here: www.keen.com

Edited 1 time(s). Last edit at 2020-03-31 18:48 by pspad.

Options: Reply | Quote | Up ^


#16 Re: Need help on Replacement Expression

Posted by: maki | Date: 2020-03-31 19:04 | IP: IP Logged

It can't be easier. Even a preschooler would understand...

URL
.ru/2020/08/76/98
Result FileName:
2020_08_76_98.ext

URL
.ru/2019/11/98-98
Result FileName:
2019_11_98-98.ext

.ext - any extension

Edited 2 time(s). Last edit at 2020-03-31 19:05 by maki.

Options: Reply | Quote | Up ^


#17 Re: Need help on Replacement Expression

Posted by: pspad | Date: 2020-03-31 19:29 | IP: IP Logged

Fast solution for your example:

search: \.ru/(\d+)/(\d+)/([0-9\-]+)/{0,}(\d{0,})
replace: $1_$2_$3_$4.ext

It isn't ideal, cause you will need in second step search for: _.ext and replace it with .ext

Options: Reply | Quote | Up ^


#18 Re: Need help on Replacement Expression

Posted by: maki | Date: 2020-03-31 20:28 | IP: IP Logged

Not Completely Correct unnecessary at the end of "_"

2019_11_98-98_.ext

shouldbe:
2019_11_98-98.ext

Edited 3 time(s). Last edit at 2020-03-31 20:31 by maki.

Options: Reply | Quote | Up ^


#19 Re: Need help on Replacement Expression

Posted by: pspad | Date: 2020-03-31 21:12 | IP: IP Logged

I see you have problem with reading. Read my whole previous answer.

Options: Reply | Quote | Up ^


#20 Re: Need help on Replacement Expression

Posted by: maki | Date: 2020-04-01 03:27 | IP: IP Logged

But this is not a valid regular expression compared to my regular expression.
\d
Any digit 0-9.

[0-9]
The digits inside the brackets can be any numbers or span of numbers from 0 to 9.

(\d+)/(\d+)/([0-9\-]+)/{0,}(\d{0,})
Match:
1999999999999999999999999999999999999999999999999999999999999999999999999999/13000000000000000000000000000000000000/54/765

Return to the first post and try again. smiling smiley

Edited 1 time(s). Last edit at 2020-04-01 03:32 by maki.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 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