<?php
declare(strict_types=1);
namespace League\CommonMark\Parser\Inline;
use League\CommonMark\Exception\InvalidArgumentException;
final class InlineParserMatch
{
private string $regex;
private bool $caseSensitive;
private function __construct(string $regex, bool $caseSensitive = false)
{
$this->regex = $regex;
$this->caseSensitive = $caseSensitive;
}
public function caseSensitive(): self
{
$this->caseSensitive = true;
return $this;
}
public function getRegex(): string
{
return '/' . $this->regex . '/' . ($this->caseSensitive ? '' : 'i');
}