Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A tool to generate semi-minimized regular expression alternations.
Given a list of str
, int
, and float
values, triex constructs a trie data structure and generates a minimized regular expression that matches all members in the trie. The regex is created walking the values left-to-right, so the best results are achieved with values that share a common prefix.
pip install py-triex
>>> from triex import Trie
>>> t = Trie(['foo', 'foobar', 'foobaz', 'bar', 'bat'])
>>> t.to_regex()
ba[rt]|foo(?:ba[rz])?
Usage: triex [OPTIONS] COMMAND [ARGS]...
A tool to generate semi-minimized regular expression alternations.
Options:
--help Show this message and exit.
-v, --verbose Increase verbosity.
--version Show the version and exit.
Commands:
batch Batch convert file contents to patterns.
convert Convert input to a regex pattern.
Convert:
$ echo "foo\nfoobar\nfoobaz\nbar\nbat" > words.txt
$ triex convert -i words.txt
ba[rt]|foo(?:ba[rz])?
$ echo -e "foo\nfoobar\nfoobaz\nbar\nbat" | triex convert
ba[rt]|foo(?:ba[rz])?
Batch:
$ printf "foo\nbar" > words1.txt
$ printf "foo\nbaz" > words2.txt
$ triex batch *.txt
Converting words1.txt
Converting words2.txt
$ less -FX words1.txt
bar|foo
$ less -FX words2.txt
baz|foo
triex is released under the MIT License
FAQs
A tool to generate semi-minimized regular expression alternations.
We found that py-triex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.