You are here: PSPad forum > English discussion forum > Re: pagenumber check .. with RE ....?

Re: pagenumber check .. with RE ....?

#1 pagenumber check .. with RE ....?

Posted by: hlk123 | Date: 2016-10-24 07:39 | IP: IP Logged

Hello

I've a 7bitASCII textfile, f.e. with the following content:
.
.
Chapter 2 Time-Domain Representations of Linear Time-Invariant Systems;97;
2.1 Introduction;97;
2.2 The Convolution Sum;98;
2.3 Convolution Sum Evaluation Procedure;102;
2.4 The Convolution Integral;115;
.
.
.

The numbers between ";" are the pagenumbers in an ebook.
I have to check (with my eyes) these characters about the following possibilities:
o instead "1" is a "l"
o instead "0" is a "O"
o must a number >= 1
o leading zero is prohibited
o space is prohibited
o etc.

Replace: "?" --> so I can see the error

Which regular expression (if possible..?) search command can do this?
Thank you for your help.

Options: Reply | Quote | Up ^


#2 Re: pagenumber check .. with RE ....?

Posted by: pspad | Date: 2016-10-24 08:08 | IP: IP Logged

Isn't better to search and fix numbers one by one instead of replacing it with '?'

Search for: ;.{0,3}\D{1,3}.{0,3};

It means your expression start and end with ";", can contain 0-3 any char, 1-3 non numeric chars and 0-3 any char

If you insist on your replace, maybe better is to add ? to your line number, e.g.

Search: (;)(.{0,3}\D{1,3}.{0,3};)
Replace: $1?$2

In case you have line:
2.3 Convolution Sum Evaluation Procedure;1O2;
you will get after replace:
2.3 Convolution Sum Evaluation Procedure;?1O2;

Now you can simple search for ;? to find wrong page numbers

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