Skip to content

Commit

Permalink
fix regex to find pandoc version
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbaber committed Jan 26, 2023
1 parent 32793bc commit 5989e15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pandoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function version()
{
$output = $this->execute(['--version']);

preg_match("/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?/", $output, $matches);
preg_match("(?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\.\d+)", $output, $matches);
list($version) = $matches;

if (!$version) {
Expand Down

0 comments on commit 5989e15

Please sign in to comment.