test si la chaine correspond au debut ou au contenu d'un bloc
@param    string $string
@param    bool $inBlock (optional) True if the parser is already in the block.
@return    boolean    true: appartient au bloc
173817
public function detect($string, $inBlock = false)
    {
        if (!preg_match($this->regexp, $string, $this->_detectMatch))
            return (0);
        if ($inBlock !== true && ((substr($string, 0, 2) == '**' && strpos($string, '**', 2) !== false) ||
                (substr($string, 0, 2) == '##' && strpos($string, '##', 2) !== false))
        )
            return (0);
        return (1);
    }
905095
public static function isMessage(string $string): bool
    {
        return substr($string, 0, 2) == self::I18N_PREFIX
            && substr($string, -2) == self::I18N_POSTFIX;
    }
609468
public function callBlock(string $block = '', ...$params): ?string
    {
        /** @var ModuleBlockInterface|null $module */
        $module = $this->module_service
            ->findByComponent(ModuleBlockInterface::class, $this->tree, Auth::user())
            ->first(static function (ModuleInterface $module) use ($block): bool {
                return $module->name() === $block && $module->name() !== 'html';
            });

        if ($module === null) {
            return '';
        }

        // Build the config array
        $cfg = [];
        foreach ($params as $config) {
            $bits = explode('=', $config);

            if (count($bits) < 2) {
                continue;
            }

            $v       = array_shift($bits);
            $cfg[$v] = implode('=', $bits);
        }

        return $module->getBlock($this->tree, 0, '', $cfg);
    }
170762
private static function stringStartsWithNumberFollowedByResource($inString,$resource)
		{
			$followingTextArray = $resource->resourceContent;
			$count = 0;
			
			foreach (str_split($inString) as $character) 
			{
				if(EndBlockFilter::characterIsDigit($character))
				{
					$count++;
				}
				else
				{
					break;
				}
			}
			
			if($count > 0)
			{
				foreach ($followingTextArray as $followingEntry) 
				{
					$formStr = sprintf('%s %s',$count,$followingEntry);
					if (0 === strpos($inString, $formStr)) 
					{
   						return true;
					}
				}
			}
			
			return false;
		}
1348934
private static function stringStartsWithResourceEntry($blockText,$resource)
		{
			foreach ($resource->resourceContent as $resourceEntry) 
			{
				if(EndBlockFilter::stringStartsWith($blockText,$resourceEntry))
				{
					return true;
				}
			}
			return false;
		}
458411
public function parseBlock(Text $content, Container $target)
    {
        $tags = implode('|', $this->getValidTags());

        $content->handle(
            '{
                ^                        # starts at the beginning or with a newline
                [ ]{0,3}                 # up to 3 leading spaces allowed
                (?:                      # start with one of the following...
                    \<(?:'.$tags.')\s*/?\>?|    # an opening HTML tag, or
                    \</(?:'.$tags.')\s*\>|      # a closing HTML tag, or
                    \<!--(-(?!-)|[^\-])*?--\>|  # a HTML comment, or
                    \<\?.*?\?\>|                # a processing instruction, or
                    \<![A-Z]+\s+[^>]+\>|        # an element type declaration, or
                    \<!\[CDATA\[.*?\]\]\>       # a CDATA section
                )
                .*?                      # match everything until...
                ((?=\\n[ ]*\\n)|\Z)      # we encounter an empty line or the end
            }imsx',
            function (Text $content) use ($target) {
                $block = new HTMLBlock($content);

                $target->addChild($block);
            },
            function (Text $part) use ($target) {
                $this->next->parseBlock($part, $target);
            }
        );
    }
772901
protected function putInCache(Block $block, Language $language, $html)
    {
        if ($block->is_cacheable) {
            cache()->tags(['blocks'])->forever('blocks:cache:' . $block->id . ':' . $language->code, $html);
        }
    }
719000
private static function debugHasKnownBlockType(array $block): bool
    {
        $result = false;

        if (array_key_exists(BlockSerializer::TYPE, $block) === true) {
            $type = $block[BlockSerializer::TYPE];

            $result =
                $type === BlockSerializer::TYPE__PROCEDURE ||
                $type === BlockSerializer::TYPE__AND_EXPRESSION ||
                $type === BlockSerializer::TYPE__OR_EXPRESSION ||
                $type === BlockSerializer::TYPE__IF_EXPRESSION;
        }

        return $result;
    }
373530
private function stringStartsWith(string $string, string $prefix): bool
    {
        return substr($string, 0, strlen($prefix)) === $prefix;
    }
119157
public function compare($string)
    {
        if (\class_exists('\Collator', false)) {
            static $collator = null;
            if ($collator === null) {
                $collator = new \Collator(\setlocale(LC_COLLATE, null));
            }

            return $collator->compare($this->_string, $string);
        }

        return \strcmp($this->_string, (string) $string);
    }
1154717
public function endsWith($string, bool $caseInsensitive = false): bool
    {
        try {
            Assert::typeOf(['string', __CLASS__], $string);
        } catch (InvalidArgumentException|TypeError $t) {
            return false;
        }

        $value  = (string) $string;
        $strLen = mb_strlen($value, $this->encoding);
        $length = $this->length();

        if ($strLen > $length) {
            return false;
        }

        return substr_compare($this->data, $value, $length - $strLen, $length, $caseInsensitive) === 0;
    }
82054
public function readString($string)
    {
        if (!is_string($string))
            throw new IniReadingException('The expected type is string');

        // PHP 5.3.3, an empty line return is needed at the end.
        $string .= "\n";

        $data = @parse_ini_string($string, true);
        if ($data === false) {
            $e = error_get_last();
            throw new IniReadingException('Syntax error in INI configuration: ' . $e['message']);
        }

        $rawValues = @parse_ini_string($string, true, INI_SCANNER_RAW);

        return $this->toCollection($this->decode($data, $rawValues));
    }
1312568
public byte[] processBlock(byte[] in, int inOff, int inLen) {
		if (forEncryption) {
			return encrypt(in, inOff, inLen);
		} else {
			return decrypt(in, inOff, inLen);
		}
	}
1102445
protected static function isTwoCharacterComment($string)
    {
        return !empty($string[1]) && (isset($string[1]) && (self::startsWithDoubleDash($string) || self::startsAsBlock($string)));
    }
519501
def in_string(objet, pattern):
        
        return bool(re.search(pattern, str(objet), flags=re.I)) if objet else False
1311605
protected function hasIn($key, $in)
    {
        $keys = explode($this->getSeparator(), $key, 2);
        if (count($keys) <= 0) {
            return false;
        } else {
            if (! isset($in[$keys[0]])) {
                return false;
            } else {
                if (count($keys) >= 2) {
                    return true && $this->hasIn($keys[1], $in[$keys[0]]);
                } else {
                    return true;
                }
            }
        }
    }
1086198
public function write($string)
    {
        $this->buffer .= $string;

        if (strlen($this->buffer) >= $this->hwm) {
            return false;
        }

        return strlen($string);
    }