nykoseki / forecastalibs
PHP Forecasta Library
Installs: 39
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nykoseki/forecastalibs
Requires
- php: >=7.0.0
- illuminate/support: ~5.0
- monolog/monolog: ^1.19
- vlucas/phpdotenv: ^2.2
Requires (Dev)
- phpunit/phpunit: 5.1.*
This package is auto-updated.
Last update: 2025-10-07 21:59:06 UTC
README
Overview
Description
様々な文字列を柔軟にパースするためのパーサコンビネータ集を提供します。 また、各種パーサコンビネータの作成を容易にするためのユーティリティも含みます。
Demo
VS.
Requirement
composer.jsonを参照してください
Usage
$parser = ParserFactory::Seq()
    ->add(ParserFactory::Token("<title>"))
    ->add(ParserFactory::Regex("/^[^<>]+/"))
    ->add(ParserFactory::Token("</title>"));
$target = "<title>Hello World</title>";
$context = $parser->parse(ParserContext::create($target));
$parsed = $context->parsed();
echo print_r($parsed);
Array
(
    [0] => <title>
    [1] => Hello World
    [2] => </title>
)
Install
composer require nykoseki/forecastalibs