2017 © Pedro Peláez
 

library regex-builder

A library for building simple regex strings procedurally

image

kyoushu/regex-builder

A library for building simple regex strings procedurally

  • Tuesday, February 17, 2015
  • by Kyoushu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

Kyoushu\RegexBuilder

Build Status, (*1)

A library for building simple regex strings procedurally, (*2)

Example

$regex = RegexBuilder::create()
    ->start()
    ->letter()->repeated()->captureAs('office')
    ->string('_')
    ->number()->repeated(3)->captureAs('id')
    ->end()
    ->getRegex();

preg_match($regex, 'OfficeName_123', $match); // Returns TRUE

$regex = RegexBuilder::create()
    ->start()
    ->letter()->repeated()->captureAs('firstWord')
    ->string('_')
    ->matchCaptured('firstWord')
    ->string('_')
    ->number()->repeated()
    ->end()
    ->getRegex();

preg_match($regex, 'bar_bar_0293', $match); // Returns TRUE

The Versions

17/02 2015

dev-master

9999999-dev

A library for building simple regex strings procedurally

  Sources   Download

MIT

The Development Requires

by James Willans

17/02 2015

1.0.0

1.0.0.0

A library for building simple regex strings procedurally

  Sources   Download

MIT

The Development Requires

by James Willans