Compilation failed: regular expression is too large at offset
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 579
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Hello,
I'm sorry, but https://github.com/smalot/pdfparser/issues/12, https://github.com/smalot/pdfparser/issues/668, or https://github.com/smalot/pdfparser/issues/709 are back again.
Trace:
In PDFObject.php line 310:
[ErrorException]
Warning: preg_match(): Compilation failed: regular expression is too large at offset 49021
Exception trace:
at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:310
Smalot\PdfParser\PDFObject->formatContent() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:436
Smalot\PdfParser\PDFObject->getSectionsText() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:689
Smalot\PdfParser\PDFObject->getTextArray() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:668
Smalot\PdfParser\PDFObject->getText() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:802
Smalot\PdfParser\PDFObject->getTextArray() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php:668
Smalot\PdfParser\PDFObject->getText() at /var/www/vendor/smalot/pdfparser/src/Smalot/PdfParser/Page.php:232
Smalot\PdfParser\Page->getText() at /var/www/src/Command/RulesIndexCommand.php:44
App\Command\RulesIndexCommand->__invoke() at n/a:n/a
ReflectionFunction->invoke() at /var/www/vendor/symfony/console/Command/InvokableCommand.php:62
Symfony\Component\Console\Command\InvokableCommand->__invoke() at /var/www/vendor/symfony/console/Command/Command.php:281
Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/console/Application.php:1144
Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/framework-bundle/Console/Application.php:123
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Application.php:379
Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/framework-bundle/Console/Application.php:86
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:218
Symfony\Component\Console\Application->run() at /var/www/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49
Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /var/www/vendor/autoload_runtime.php:32
require_once() at /var/www/bin/console:15
file: pandemie.pdf
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the attached pandemie.pdf, then inspect src/Smalot/PdfParser/PDFObject.php around line 310 and follow formatContent() through the stack trace. Determine how this PDF produces the oversized regular expression, and verify that parsing its text completes without the preg_match compilation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 55/100