Trex

0.1.0

trex as PowerShell cmdlets and objects: a regex-shaped pattern language over typed tokens. A pattern matches a whole number, word, quoted string, IP address, URL, email, timestamp, version and 17 more kinds as one atom each, binds named registers a later token must equal, and matches balanced bracket groups, with no backtracking. Custom atoms are declared for the sess
trex as PowerShell cmdlets and objects: a regex-shaped pattern language over typed tokens. A pattern matches a whole number, word, quoted string, IP address, URL, email, timestamp, version and 17 more kinds as one atom each, binds named registers a later token must equal, and matches balanced bracket groups, with no backtracking. Custom atoms are declared for the session with Register-TrexAtom or read from pattern files with Import-TrexAtom, and every cmdlet reads them. Every cmdlet also answers to a shorter name with the Tx prefix. Bound to the Rust directly with PoWerRuSt (pwrs).
Show more

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Trex

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Trex

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Mark Newton

Package Details

Author(s)

  • Mark Newton

Tags

pwrs powershell regex tokens pattern-matching text-search cmdlet

Cmdlets

New-TrexPattern Select-TrexMatch Test-TrexMatch Get-TrexFile Get-TrexFileType Get-TrexLine New-TrexStreamScanner Edit-TrexText Protect-TrexText Group-TrexMatch Get-TrexToken Get-TrexRecord Get-TrexRecordShape ConvertTo-TrexPattern ConvertFrom-TrexText ConvertTo-TrexLiteral Find-TrexRecord New-TrexIndex Get-TrexIndex Get-TrexRule Invoke-TrexRule ConvertTo-TrexSarif Measure-TrexMagnitude Measure-TrexStress Measure-TrexFlow Measure-TrexObservation Measure-TrexEcho Measure-TrexOrbit Measure-TrexShape Measure-TrexRelation Measure-TrexSpectral Measure-TrexSeam New-TrexGrammar Invoke-TrexGrammar New-TrexBpe Import-TrexBpe Export-TrexBpe ConvertTo-TrexBpe New-TrexPrefilter Test-TrexPrefilter Register-TrexAtom Import-TrexAtom Get-TrexAtom Unregister-TrexAtom Test-TrexAtom New-TrexLibrary Get-TrexClock Set-TrexClock Get-TrexInfo

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

The first release of Trex: trex's pattern language over typed tokens as PowerShell cmdlets and objects. Select-TrexMatch scans text, files and directory trees; Edit-TrexText rewrites, Protect-TrexText redacts, Group-TrexMatch counts and groups; Register-TrexAtom and Import-TrexAtom declare custom atoms every cmdlet reads; ConvertTo-TrexPattern builds a pattern from marked examples and ConvertFrom-TrexText applies it as objects, reading ConvertFrom-String templates. It imports in PowerShell 7 and Windows PowerShell 5.1.

FileList

Version History

Version Downloads Last updated
0.1.0 (current version) 7 9/30/2026