PHPackages                             ballen/linguist - 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. ballen/linguist

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

ballen/linguist
===============

Linguist is a PHP library for parsing strings and extracting prefixed words in content ideal for working with @mentions, #topics and custom tags.

2.0.3(3y ago)212.1k2[1 PRs](https://github.com/allebb/linguist/pulls)GPL-3.0-or-laterPHPPHP ^7.3.0|^8.0.0CI passing

Since May 11Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/allebb/linguist)[ Packagist](https://packagist.org/packages/ballen/linguist)[ RSS](/packages/ballen-linguist/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (12)Used By (0)

Linguist
========

[](#linguist)

[![Build](https://github.com/allebb/linguist/workflows/build/badge.svg)](https://github.com/allebb/linguist/actions)[![Code Coverage](https://camo.githubusercontent.com/31cfd300faa7f16ca6dd675d25f919adc895585fcd9e8f0ae2f759122fe5841b/68747470733a2f2f636f6465636f762e696f2f67682f616c6c6562622f6c696e67756973742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/allebb/linguist)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b2e98c3d8a81247acddc4ed108c7b88396263e023f0befb2798d2fef68e59163/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6c6562622f6c696e67756973742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/allebb/linguist/?branch=master)[![Code Climate](https://camo.githubusercontent.com/d3ac1587c6ab3288440b4fe479164614614c4bbc45f29c00139f60be00c1bca3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f616c6c6562622f6c696e67756973742f6261646765732f6770612e737667)](https://codeclimate.com/github/allebb/linguist)[![Latest Stable Version](https://camo.githubusercontent.com/4999c753f4e7177e105ff3239ff79ad61e68f6e9abefcb17dd643620b9c9a2d8/68747470733a2f2f706f7365722e707567782e6f72672f62616c6c656e2f6c696e67756973742f762f737461626c65)](https://packagist.org/packages/ballen/linguist)[![Latest Unstable Version](https://camo.githubusercontent.com/8d5dbeb19e8652316b5576980b87e48abd78bbfdcd6fc48f5d3b41b5a493c4a9/68747470733a2f2f706f7365722e707567782e6f72672f62616c6c656e2f6c696e67756973742f762f756e737461626c65)](https://packagist.org/packages/ballen/linguist)[![License](https://camo.githubusercontent.com/74ff06673e0af0900cde9cdb0362fad016387f5f281d90b7bc621d094573b87d/68747470733a2f2f706f7365722e707567782e6f72672f62616c6c656e2f6c696e67756973742f6c6963656e7365)](https://packagist.org/packages/ballen/linguist)

Linguist is a PHP library for parsing strings, it can extract and manipulate prefixed words in content ideal for working with @mentions, #topics and custom tags!

Requirements
------------

[](#requirements)

- PHP &gt;= 7.3.0

This library is unit tested against PHP 7.3, 7.4, 8.0, 8.1 and 8.2!

If you need to use an older version of PHP, you should instead install the 1.x version of this library (see below for details).

License
-------

[](#license)

This library is released under the [GPLv3](https://raw.githubusercontent.com/allebb/linguist/master/LICENSE) license, you are welcome to use it, improve it and contribute your changes back!

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

[](#installation)

The recommended way of installing this library is via. [Composer](http://getcomposer.org); To install using Composer type the following command at the console:

```
composer require ballen/linguist
```

**If you need to use an older version of PHP, version 1.x.x supports PHP 5.6, 7.0, 7.1 and 7.2, you can install this version using Composer with this command instead:**

```
composer require ballen/linguist ^1.0
```

Examples
--------

[](#examples)

A set of working examples can be found in the `/examples` directory.

Tests and coverage
------------------

[](#tests-and-coverage)

This library is fully unit tested using [PHPUnit](https://phpunit.de/).

I use [GitHub Actions](https://github.com/) for continuous integration, which triggers tests for PHP 7.3, 7.4, 8.0, 8.1 and 8.2 every time a commit is pushed.

If you wish to run the tests yourself you should run the following:

```
# Install the Linguist Library with the 'development' packages this then includes PHPUnit!
composer install

# Now we run the unit tests (from the root of the project) like so:
./vendor/bin/phpunit
```

Code coverage can also be run but requires XDebug installed...

```
./vendor/bin/phpunit --coverage-html ./report
```

Support
-------

[](#support)

I am happy to provide support via. my personal email address, so if you need a hand drop me an email at: ballen@bobbyallen.me.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance53

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~348 days

Recently: every ~265 days

Total

9

Last Release

1238d ago

Major Versions

1.0.4 → 2.0.02020-12-23

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

2.0.0PHP &gt;=7.3.0

2.0.2PHP ^7.3.0|^8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4729a376aa8281d9456a90c000e991aa605c96f15251469acd5a7a5c6cdde2e6?d=identicon)[allebb](/maintainers/allebb)

---

Top Contributors

[![allebb](https://avatars.githubusercontent.com/u/767628?v=4)](https://github.com/allebb "allebb (63 commits)")

---

Tags

hashtagphpstringstring-matchingstring-searchtagstextextractingtwittertwittertagstopicsmentions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ballen-linguist/health.svg)

```
[![Health](https://phpackages.com/badges/ballen-linguist/health.svg)](https://phpackages.com/packages/ballen-linguist)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

18934.7M29](/packages/mck89-peast)[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

332467.0k4](/packages/arcanedev-seo-helper)[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[ergebnis/json

Provides a Json value object for representing a valid JSON string.

2521.7M8](/packages/ergebnis-json)[ergebnis/json-pointer

Provides an abstraction of a JSON pointer.

2021.8M6](/packages/ergebnis-json-pointer)[hut6/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

102.3k](/packages/hut6-oembed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
