You are here: PSPad forum > English discussion forum > Regex issue (percentages)
Posted by: maki | Date: 2018-06-29 08:06 | IP: IP Logged
All regex not work !!!
---------------------------
Info
---------------------------
Next occurrence of "[^\d\.]\d{1,2}(\.\d%|%)" not found.
---------------------------
OK
---------------------------
Posted by: pspad | Date: 2018-06-29 08:24 | IP: IP Logged
You have square brackets in first part, why? Maybe it's time to read something about regular expressions.
Use this:
\s\d{1,2}(\.\d{1,2}%|%)
Edited 1 time(s). Last edit at 2018-06-29 08:26 by pspad.
Posted by: vbr | Date: 2018-06-29 15:48 | IP: IP Logged
Hi,
the regex search fails as expected on the given text
the starting part:
[^\d\.]
requires exactly one character other than a digit or a dot, which are not there at the given positions.
Using regex search for this might be rather demanding to get right;
if your log data for downloads are always on single line and you want to filter lines for incomplete downloads, it might be possible without regex in pspad.
in the Find dialog (Ctrl+F) use the pattern
100%
check [x] Copy non-matching
and click [Copy]
The resulting lines (other than those containing 100%) are then copied to a new file.
If there are other irrelevant lines in your data file, you can list only those containing "%"
again, use % in the search field,
uncheck [x] Copy non-matching
and click [Copy].
hth,
vbr
Edited 1 time(s). Last edit at 2018-06-29 15:49 by vbr.
Posted by: aGerman | Date: 2018-06-29 16:31 | IP: IP Logged
Posted by: pspad | Date: 2018-06-29 17:26 | IP: IP Logged
maki:
I provided you working expression for your purposes in my latest answer.
You have no intention to learn, you have no intention to read answers.
Edited 1 time(s). Last edit at 2018-06-29 17:27 by pspad.
Posted by: Andreas | Date: 2018-06-30 11:14 | IP: IP Logged
@maki
First try on this page before asking: regex101.com
^\d*\.?\d*%
Posted by: maki | Date: 2018-07-05 13:08 | IP: IP Logged
I tested and found only percentages, not the full name with percentages. Regex can be compliced for 10000000 of different path... so it does not work correctly.
Posted by: aGerman | Date: 2018-07-05 18:04 | IP: IP Logged
maki:Regex can be compliced for 10000000 of different path...
No, that's exactly what Regex is made for. You just have to specify the rules and that's it. The right pattern will work for 10 lines as good as for 10000000 lines.
(^|(^.*[^\.\d]+))\d{1,2}(\.\d%|%)
Steffen
Posted by: maki | Date: 2018-07-06 09:53 | IP: IP Logged
aGerman:maki:Regex can be compliced for 10000000 of different path...No, that's exactly what Regex is made for. You just have to specify the rules and that's it. The right pattern will work for 10 lines as good as for 10000000 lines.
(^|(^.*[^\.\d]+))\d{1,2}(\.\d%|%)
Steffen
Work
R:\Gym\-5076373\-13974757_348284311.jpg -> I:\Gym\-5076373\-13974757_348284311.jpg - Kopiowanie zakończone powodzeniem 100%
R:\Gym\-5076373\-13974757_392683937.jpg -> I:\Gym\-5076373\-13974757_392683937.jpg - Kopiowanie zakończone powodzeniem 99.9%
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