<commit_before><?php

namespace Raideer\Tweech;

class Parser
{
    /**
    * Holds the regex for parsing the message.
    *
    * @var string/regex
    */
    protected $messageRegex;
    protected $messageRegexBasic;

    /**
    * Holds regex array for parsing parameters.
    *
    * @var array
    */
    protected $paramsRegex;

    public function __construct()
    {

        /*
         * Regex for parsing the message
         * http://tools.ietf.org/html/rfc1459#section-2.3.1
         */

        $space = ' ';
        $null = '\\x00';
        $crlf = "\r\n";
        $letters = 'A-Za-z';
        $numbers = '0-9';
        $special = preg_quote('[]\`_^{|}');
        $tagsSpecial = preg_quote('#:-_,\/');

        $trailing = "[^$null$crlf]*";
        $username = "[$letters$numbers$special]+";
        $server = "[$letters$numbers$special\.]+";

        $tags = "(?:(?:[$letters$numbers\-]+)=(?:(?:[$letters$numbers$tagsSpecial]+)?;?)?)+\s";

        $command = "(?P<command>[A-Z]+|[$numbers]{3})";

        $params = "(?P<params>$trailing)";

        $prefix = "(?:(?P<servername>$server)|(?P<nick>$username)(?P<user>!$username)(?P<host>@$server))";

        $compiled = "(?:@(?P<tags>$tags))?(?::(?P<prefix>$prefix)$space)?$command$space$params$crlf";

        /*<commit_msg>Fixing tags<commit_after><?php

namespace Raideer\Tweech;

class Parser
{
    /**
    * Holds the regex for parsing the message.
    *
    * @var string/regex
    */
    protected $messageRegex;
    protected $messageRegexBasic;

    /**
    * Holds regex array for parsing parameters.
    *
    * @var array
    */
    protected $paramsRegex;

    public function __construct()
    {

        /*
         * Regex for parsing the message
         * http://tools.ietf.org/html/rfc1459#section-2.3.1
         */

        $space = ' ';
        $null = '\\x00';
        $crlf = "\r\n";
        $letters = 'A-Za-z';
        $numbers = '0-9';
        $special = preg_quote('[]\`_^{|}');
        $tagsSpecial = preg_quote('#:-_,');

        $trailing = "[^$null$crlf]*";
        $username = "[$letters$numbers$special]+";
        $server = "[$letters$numbers$special\.]+";

        $tags = "(?:(?:[$letters$numbers\-]+)=(?:(?:[$letters\/$numbers$tagsSpecial]+)?;?)?)+\s";

        $command = "(?P<command>[A-Z]+|[$numbers]{3})";

        $params = "(?P<params>$trailing)";

        $prefix = "(?:(?P<servername>$server)|(?P<nick>$username)(?P<user>!$username)(?P<host>@$server))";

        $compiled = "(?:@(?P<tags>$tags))?(?::(?P<prefix>$prefix)$space)?$command$space$params$crlf";

        /*
{'fraction_non_alphanumeric': 0.22808378588052755, 'fraction_numerical': 0.009309542280837859, 'mean_word_length': 2.4571045576407506, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, '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': '1946922', 'n_tokens_mistral': 950, 'n_tokens_neox': 874, 'n_words': 133}