2017 © Pedro Peláez
 

library strscan

Simple string tokenizer for lexical scanning operations

image

strscan/strscan

Simple string tokenizer for lexical scanning operations

  • Saturday, June 21, 2014
  • by nramenta
  • Repository
  • 3 Watchers
  • 11 Stars
  • 3,042 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 12 % Grown

The README.md

strscan-php

strscan-php is a simple string tokenizer for lexical scanning operations. It's a PHP port of strscan-js, which in turn is a JavaScript port of the Ruby library with the same name. This library assumes the mbstring extension is enabled and all strings to be UTF-8., (*1)

Installation

The recommended way to install strscan-php is through composer., (*2)

Usage

<?php
include '/path/to/StrScan/StringScanner.php';
use StrScan\StringScanner;
$s = new StringScanner("This is a test");
$s->scan("/\w+/");             # => "This"
$s->scan("/\w+/");             # => null
$s->scan("/\s+/");             # => " "
$s->scan("/\s+/");             # => null
$s->scan("/\w+/");             # => "is"
$s->hasTerminated();           # => false
$s->scan("/\s+/");             # => " "
$s->scan("/(\w+)\s+(\w+)/");   # => "a test"
$s->getMatch();                # => "a test"
$s->getCapture(0);             # => "a"
$s->getCapture(1);             # => "test"
$s->hasTerminated();           # => true

License

strscan-php is released under the MIT license., (*3)

Acknowledgments

The original strscan-js was written by Sam Stephenson., (*4)

The Versions

21/06 2014

dev-master

9999999-dev

Simple string tokenizer for lexical scanning operations

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nofriandi Ramenta

lexer scanner

21/06 2014

1.0.3

1.0.3.0

Simple string tokenizer for lexical scanning operations

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nofriandi Ramenta

lexer scanner

04/06 2014

1.0.2

1.0.2.0

Simple string tokenizer for lexical scanning operations

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nofriandi Ramenta

lexer scanner

06/09 2012

1.0.1

1.0.1.0

Simple string tokenizer for lexical scanning operations

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nofriandi Ramenta

lexer scanner

24/08 2012

1.0.0

1.0.0.0

Simple string tokenizer for lexical scanning operations

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nofriandi Ramenta

lexer scanner