PHPackages                             silentbyte/sb-dynlex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. silentbyte/sb-dynlex

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

silentbyte/sb-dynlex
====================

A dynamically configurable lexer library featuring a fluid API.

1.1.0(9y ago)28652MITPHP

Since Dec 2Pushed 8y ago4 watchersCompare

[ Source](https://github.com/SilentByte/sb-dynlex)[ Packagist](https://packagist.org/packages/silentbyte/sb-dynlex)[ Docs](https://github.com/SilentByte/sb-dynlex)[ RSS](/packages/silentbyte-sb-dynlex/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

DynLex Dynamically Configurable Lexer Library
=============================================

[](#dynlex-dynamically-configurable-lexer-library)

[![Build Status](https://camo.githubusercontent.com/331f8adfc2da59d285727f3929165a8112698eb308214e45764bb6fd3f7b9bd3/68747470733a2f2f7472617669732d63692e6f72672f53696c656e74427974652f73622d64796e6c65782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SilentByte/sb-dynlex)[![Latest Stable Version](https://camo.githubusercontent.com/5d66fe77f6baaf708d256734a9ee4e9106bc3a658ee6edc2f88c04e583036d5f/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696c656e74627974652f73622d64796e6c65782e737667)](https://packagist.org/packages/silentbyte/sb-dynlex)[![MIT License](https://camo.githubusercontent.com/100dc28a5ba93243f079e1a372e19636ec4bc6b2445a282b04a0a62baab5d80e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542532304c6963656e73652d626c75652e737667)](https://opensource.org/licenses/MIT)

This is the main repository of the SilentByte DynLex Lexer Library.

DynLex is an easy-to-use library for PHP that provides the functionality to create and use dynamically configurable lexers accessed via a fluid interface.

Official documentations can be found here:

Installation
------------

[](#installation)

To install the latest version, either checkout and include the source directly or use:

```
$ composer require silentbyte/sb-dynlex
```

General Usage
-------------

[](#general-usage)

DynLex allows the definition of a set of lexer rules that determine how the input is scanned and what tokens can be created. The following code is a simple example that tokenizes words and numbers:

```
