Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/main/lib/Validation/Rule/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/main/lib/Validation/Rule/RegExp.php

<?php

declare(strict_types=1);

namespace Bitrix\Main\Validation\Rule;

use Attribute;
use Bitrix\Main\Validation\Validator\RegExpValidator;

#[Attribute(Attribute::TARGET_PROPERTY)]
class RegExp extends AbstractPropertyValidationAttribute
{
	public function __construct(
		private readonly string $pattern,
		private readonly int $flags = 0,
		private readonly int $offset = 0,
		protected ?string $errorMessage = null
	)
	{
	}

	protected function getValidators(): array
	{
		return [
			(new RegExpValidator($this->pattern, $this->flags, $this->offset)),
		];
	}
}