<commit_before><?php

namespace Liquid;

/**
 * Liquid 3.0
 */
class Liquid {

    /** @var array */
    protected $config;

    const FilterSeparator             = '\|';
    const ArgumentSeparator           = ',';
    const FilterArgumentSeparator     = ':';
    const VariableAttributeSeparator  = '.';
    const TagStart                    = '\{\%';
    const TagEnd                      = '\%\}';
    const VariableSignature           = '\(?[\w\-\.\[\]]\)?';
    const VariableSegment             = '[\w\-]';
    const VariableStart               = '\{\{';
    const VariableEnd                 = '\}\}';
    const VariableIncompleteEnd       = '\}\}?';
    const QuotedString                = '"[^"]*"|\'[^\']*\'';


    const ERROR_MODE_LAX = 'lax';
    const ERROR_MODE_WARN = 'warn';
    const ERROR_MODE_STRICT = 'strict';

    public static $QuotedFragment;
    public static $TagAttributes;
    public static $AnyStartingTag;
    public static $PartialTemplateParser;
    public static $TemplateParser;
    public static $VariableParser;
    public static $PART_QuotedFragment;

    public static function init()
    {
        /**
         * PHP does not support evaluating statements when setting constants / class variables.
         */


        $partialTemplateParser               = static::TagStart . '.*?' . static::TagEnd . '|'. static::VariableStart . '.*?' . static::VariableIncompleteEnd;
        $anyStartingTag                      = '\{\{|\{\%';

        static::$PART_QuotedFragment         = static::QuotedString . '|(?:[^\s,\|\'"]|' . static::QuotedString . ')+';

        static::$QuotedFragment              = '/' . static::$PART_QuotedFragment . '/S';
        static::$TagAttributes               = '/(\w+)\s*\:\s*(' . static::$PART_QuotedFragment . ')/S';
        static::$AnyStartingTag              = '/'. $anyStartingTag . '/S';
        static::$PartialTemplateParser       = '/' . $partialTemplateParser . '/Sm';
        static::$TemplateParser              = '/(' . $partialTemplateParser . '|' . $anyStartingTag . ')/Sm';

        static::$VariableParser              = '/\[[^\]]+\]|' . static::VariableSegment . '+\??/S';
    }
}

Liquid::init();<commit_msg>- Updated the regexes to match https://github.com/Shopify/liquid/pull/170<commit_after><?php

namespace Liquid;

/**
 * Liquid 3.0
 */
class Liquid {

    /** @var array */
    protected $config;

    const FilterSeparator             = '\|';
    const ArgumentSeparator           = ',';
    const FilterArgumentSeparator     = ':';
    const VariableAttributeSeparator  = '.';
    const TagStart                    = '\{\%';
    const TagEnd                      = '\%\}';
    const VariableSignature           = '\(?[\w\-\.\[\]]\)?';
    const VariableSegment             = '[\w\-]';
    const VariableStart               = '\{\{';
    const VariableEnd                 = '\}\}';
    const VariableIncompleteEnd       = '\}\}?';
    const QuotedString                = '(?:"(?:[^"\\\\]|\\\\.)*"|\'(?:[^\'\\\\]|\\\\.)*\')';


    const ERROR_MODE_LAX = 'lax';
    const ERROR_MODE_WARN = 'warn';
    const ERROR_MODE_STRICT = 'strict';

    public static $QuotedFragment;
    public static $TagAttributes;
    public static $AnyStartingTag;
    public static $PartialTemplateParser;
    public static $TemplateParser;
    public static $VariableParser;
    public static $PART_QuotedFragment;

    public static function init()
    {
        /**
         * PHP does not support evaluating statements when setting constants / class variables.
         */
        $partialTemplateParser = static::TagStart . '(?:' . static::QuotedString . '|.*?)*' . static::TagEnd . '|' . static::VariableStart . '(?:' . static::QuotedString . '|.*?)*' . static::VariableEnd;
        $anyStartingTag                      = '\{\{|\{\%';

        static::$PART_QuotedFragment         = static::QuotedString . '|(?:[^\s,\|\'"]|' . static::QuotedString . ')+';

        static::$QuotedFragment              = '/' . static::$PART_QuotedFragment . '/S';
        static::$TagAttributes               = '/(\w+)\s*\:\s*(' . static::$PART_QuotedFragment . ')/S';
        static::$AnyStartingTag              = '/'. $anyStartingTag . '/S';
        static::$PartialTemplateParser       = '/' . $partialTemplateParser . '/Sm';
        static::$TemplateParser              = '/(' . $partialTemplateParser . '|' . $anyStartingTag . ')/Sm';

        static::$VariableParser              = '/\[[^\]]+\]|' . static::VariableSegment . '+\??/S';
    }
}

Liquid::init();
{'fraction_non_alphanumeric': 0.18252041491944382, 'fraction_numerical': 0.001544912822776429, 'mean_word_length': 1.9390402075226978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2431236', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1253, 'n_words': 233}