https://github.com/aternus/stringy-patterns
A PHP string pattern detection library with multibyte support
https://github.com/aternus/stringy-patterns
Last synced: 3 months ago
JSON representation
A PHP string pattern detection library with multibyte support
- Host: GitHub
- URL: https://github.com/aternus/stringy-patterns
- Owner: Aternus
- License: mit
- Created: 2017-12-30T21:27:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-09T10:22:46.000Z (over 6 years ago)
- Last Synced: 2024-11-16T08:35:40.008Z (7 months ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Stringy Patterns
A PHP string pattern detection library with multibyte support.
```php
use Stringy\Patterns as P;// get all patterns
$results_array = P::create('abcdabcdab')->getPatterns();// get all patterns, include single occurrences
$results_array = P::create('abcdabcdab')->getPatterns(true);
```* [Why?](#why)
* [Installation](#installation)
* [Other Useful Libraries](#other-useful-libraries)
* [License](#license)## Why?
Patterns are all around us, perhaps _you_ will find something useful.
## Installation
If you're using Composer to manage dependencies:
```
composer require aternus/stringy-patterns
```Then, after running `composer update`, you can load the class using Composer's autoloading:
```php
require 'vendor/autoload.php';
```Otherwise, you can simply require the file directly:
```php
require_once 'vendor/aternus/stringy-patterns/src/Patterns.php';
```And in either case, I'd suggest using an alias.
```php
use Stringy\Patterns as P;
```Please note that Stringy Patterns relies on the `mbstring` module for its underlying
multibyte support. If the module is not found, and as long as you've installed
Stringy Patterns using composer, Stringy Patterns will use
[symfony/polyfill-mbstring](https://github.com/symfony/polyfill-mbstring).
For OSX users, it's a default for any version of PHP installed with homebrew.
If compiling PHP from scratch, it can be included with the `--enable-mbstring` flag.## Other Useful Libraries
* [Stringy](https://github.com/danielstjules/Stringy):
A PHP string manipulation library with multibyte support## License
Released under the MIT License - see `LICENSE.md` for details.