You are here: PSPad forum > English discussion forum > regex

regex

#1 regex

Posted by: maki | Date: 2014-09-22 08:00 | IP: IP Logged

E:\DOKUM 2\102_0\-Zui53f_-aW6aU.txt -> D:\dokum ko 2\101_0\-Zui53f_-W6aU.txt - Kopiowanie zakończone powodzeniem

^.*?(->) (left side)

....... (right side???)

Options: Reply | Quote | Up ^


#2 Re: regex

Posted by: pspad | Date: 2014-09-22 09:00 | IP: IP Logged

We see the original line. What should be result? You want to search something or replace something or?

Options: Reply | Quote | Up ^


#3 Re: regex

Posted by: maki | Date: 2014-09-22 10:08 | IP: IP Logged

I want to delete the right side*

LEFT -> RIGHT*

Edited 1 time(s). Last edit at 2014-09-22 10:08 by maki.

Options: Reply | Quote | Up ^


#4 Re: regex

Posted by: pspad | Date: 2014-09-22 11:52 | IP: IP Logged

Search: \s\-\>.*
replace:

replace with nothing will delete your right side

Options: Reply | Quote | Up ^


#5 Re: regex

Posted by: maki | Date: 2014-09-22 12:08 | IP: IP Logged

Incorrect regex - should be without find "->" (RIGHT)

"->" (only LEFT)

Edited 1 time(s). Last edit at 2014-09-22 12:09 by maki.

Options: Reply | Quote | Up ^


#6 Re: regex

Posted by: pspad | Date: 2014-09-22 12:19 | IP: IP Logged

Wasted time again and again sad smiley

Original line:
E:\DOKUM 2\102_0\-Zui53f_-aW6aU.txt -> D:\dokum ko 2\101_0\-Zui53f_-W6aU.txt - Kopiowanie zakończone powodzeniem

result should be:
E:\DOKUM 2\102_0\-Zui53f_-aW6aU.txt
or result should be:
E:\DOKUM 2\102_0\-Zui53f_-aW6aU.txt ->

Options: Reply | Quote | Up ^


#7 Re: regex

Posted by: maki | Date: 2014-09-22 12:24 | IP: IP Logged

(LEFT SIDE) ^.*?(->) (post#1)
E:\DOKUM 2\102_0\-Zui53f_-aW6aU.txt ->

(RIGHT SIDE) (example regex find?)
D:\dokum ko 2\101_0\-Zui53f_-W6aU.txt - Kopiowanie zakończone powodzeniem

Edited 4 time(s). Last edit at 2014-09-22 12:26 by maki.

Options: Reply | Quote | Up ^


#8 Re: regex

Posted by: pspad | Date: 2014-09-22 13:18 | IP: IP Logged

You wrote you want to delete right side.
If you want to keep -> use this expression:

Search: (\s\-\>).*
Replace: $1

Options: Reply | Quote | Up ^


#9 Re: regex

Posted by: maki | Date: 2014-09-22 16:20 | IP: IP Logged

Other regex:

Find: 00 OR 000
59854321_00
984321_000

Not Find: 0
565343_0

(\d+)_......

Edited 2 time(s). Last edit at 2014-09-22 16:29 by maki.

Options: Reply | Quote | Up ^


#10 Re: regex

Posted by: pspad | Date: 2014-09-22 16:48 | IP: IP Logged

Search for: \d+_0{2,3}

It means any count of digits, folllowed by underscore, followed by 2-3 zeroes

Options: Reply | Quote | Up ^






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