sciphp/numphp

View on GitHub
src/SciPhp/NdArray/IndexInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace SciPhp\NdArray;

/**
 * Indexing constants
 */
interface IndexInterface
{
    /**
     * Index must contain only these characters
     */
    public const IDX_PAT_FILTER = '/^[,-:\d\s]+$/i';

    /**
     * Index pattern for parsing
     */
    public const IDX_PAT_PARSE = '/\s*
          (?P<start>-?\d+)?\s*
          (?P<col>:)      ?\s*
          (?P<stop>-?\d+) ?\s*
          (?P<comma>,)    ?\s*/ix
  ';
}