| Post Reply | RetroFed Forum Forum Index » Bug reports 🐞on🐛any🦠software🪲 |
| Author | Message | ||
|---|---|---|---|
|
evenwicht
lemmy.sdf.org
evenwicht@lemmy.sdf.org Joined: 2024-07-01 |
(Apologies for publicly posting a link into Cloudflare’s walled-garden, but archive.org comes up empty.) The linked bug report shows that astonishing but deliberate regular expression treatment was reported 9 years ago. Still today I spent time trying to work out why my regular expression was not matching only to find that the dev hi-jacked the meaning of ^ and $ for another purpose. Man page still neglects to warn users. |
||
| 5 Original | |||
rbos
lemmy.ca
rbos@lemmy.caJoined: 2023-06-08 |
It makes sense that pdfs don't really have 'lines' in the same way. |
||
| 3 | |||
|
evenwicht
lemmy.sdf.org
evenwicht@lemmy.sdf.org Joined: 2024-07-01 |
It makes sense that pdfs don't really have 'lines' in the same way.
If I say match In any case, docs that lie or omit something important are always a bug. Man page says: “pdfgrep tries to be mostly compatible with GNU grep with some PDF-specific distinctions and additional options. Most notably, -n prints page instead of line numbers.” No mention of changing the meaning of |
||
| 2 | |||
|
turdas
suppo.fi
turdas@suppo.fi Joined: 2023-06-17 |
If I say match a b, without the concept of a line you would be unable to even work out whether a comes immediately before a space which is immediately before b with nothing else in between. Lines are indispensible for determining sequence. Whether a pattern is a b or ^b, the tool necessarily must determine what, if anything, is to the left of b. The dev took a shortcut and skipped the effort of...
You must just not have encountered a PDF that renders the page in a very strange way. The exact situation mentioned by the developer as an example in that report of a two-column PDF merging both columns into one line is very common. I don't have such a PDF at hand but in my experience this is particularly common for scanned documents that have OCR'd text content. I'm positive that pdftotext would trip up on those too, because what else could it do than show the text as it is logically laid out in the file? If the functionality was different, people would just be complaining about a different incongruency. |
||
| 2 | |||
|
evenwicht
lemmy.sdf.org
evenwicht@lemmy.sdf.org Joined: 2024-07-01 |
You must just not have encountered a PDF that renders the page in a very strange way. The exact situation mentioned by the developer as an example in that report of a two-column PDF merging both columns into one line is very common. I don't have such a PDF at hand but in my experience this is particularly common for scanned documents that have OCR'd text content. I'm positive that pdftotext wou...
A scanned document is trivially rendered. So you must be referring to pure vector PDFs. With pure vector PDFs, the PDF generator is responsible for the contents. Indeed the PDF standard is about as shitty as the HTML standard and the quality of results are a product of the quality of the input. But in the case at hand, we are not really talking about managing poor quality input. how
|
||
| 1 | |||
rbos
lemmy.ca
rbos@lemmy.caJoined: 2023-06-08 |
If I say match a b, without the concept of a line you would be unable to even work out whether a comes immediately before a space which is immediately before b with nothing else in between. Lines are indispensible for determining sequence. Whether a pattern is a b or ^b, the tool necessarily must determine what, if anything, is to the left of b. The dev took a shortcut and skipped the effort of...
Yeah, it does add some confusion. It should be documented, or maybe the use of ^ and $ should be explicitly refused except by special flag, or something. |
||
| 2 | |||
| Post Reply |
Back to top |