https://github.com/makarms/text-probe
Simple and extensible PHP library for text analysis and pattern matching, designed to help developers probe, parse, and manipulate text efficiently.
https://github.com/makarms/text-probe
addresses-parsing contributions-welcome datetime discord email good-first-contribution good-first-issue good-first-pr help-wanted mbstring open-source phone-number php regex regexp slack telegram text-analysis uuid
Last synced: 14 days ago
JSON representation
Simple and extensible PHP library for text analysis and pattern matching, designed to help developers probe, parse, and manipulate text efficiently.
- Host: GitHub
- URL: https://github.com/makarms/text-probe
- Owner: MakarMS
- License: mit
- Created: 2025-07-23T22:08:45.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-09-29T23:08:21.000Z (6 months ago)
- Last Synced: 2025-09-30T01:09:53.543Z (6 months ago)
- Topics: addresses-parsing, contributions-welcome, datetime, discord, email, good-first-contribution, good-first-issue, good-first-pr, help-wanted, mbstring, open-source, phone-number, php, regex, regexp, slack, telegram, text-analysis, uuid
- Language: PHP
- Homepage:
- Size: 95.7 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# TextProbe
[](https://packagist.org/packages/makarms/text-probe) [](https://packagist.org/packages/makarms/text-probe) [](https://github.com/MakarMS/text-probe/actions/workflows/php-tests.yml) [](https://codecov.io/github/MakarMS/text-probe) [](https://packagist.org/packages/makarms/text-probe)
**TextProbe** is a simple and extensible PHP library for text analysis and pattern matching. Designed to help
developers probe, parse, and manipulate text efficiently using customizable rules and matchers.
## Features
- 🧠Easy-to-use API for text matching and parsing
- 🔧 Extensible architecture — write your own matchers and rules
- 💡 Suitable for parsing logs, user input, or any structured text
## Installation
You can install the library via [Composer](https://getcomposer.org/):
```bash
composer require makarms/text-probe
```
## Available Probes
TextProbe includes a wide range of built-in probes. Probes are fully extensible and support custom validation via the `IProbe` and `IValidator` interfaces.
See the [Probe Index](docs/probes.md) for the full categorized list.
## Usage
```php
require __DIR__ . '/vendor/autoload.php';
use TextProbe\TextProbe;
use TextProbe\Probes\Contact\EmailProbe;
$text = "Please contact us at info@example.com for more details.";
$probe = new TextProbe();
$probe->addProbe(new EmailProbe());
$results = $probe->analyze($text);
foreach ($results as $result) {
echo sprintf(
"[%s] %s (position %d-%d)\n",
$result->getProbeType()->name,
$result->getResult(),
$result->getStart(),
$result->getEnd()
);
}
```
### Expected output
```text
[EMAIL] info@example.com (position 21-37)
```