
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
rector
Advanced tools
Rector turns example strings into optimized regular expressions you can reuse in search, validation, or routing rules. It ships with a trie-based engine that produces compact, deterministic patterns (also used by the CLI).
pip install rector
from rector import TrieRegexGenerator
# Build a minimal trie-based pattern for larger sets or ranges
numbers = (
TrieRegexGenerator()
.add_examples([str(n) for n in range(10, 1000)])
.generate()
)
assert numbers.pattern == "^[1-9][0-9]{1,2}$"
# Generate from small fixed-length samples
words = TrieRegexGenerator().add_examples(["cat", "car", "cap"]).generate()
assert words.pattern == r"^ca[prt]$"
Pipe examples to rector and it prints the generated pattern to stdout:
printf "cat\ncar\ncap\n" | rector
# -> ^ca[prt]$
The CLI anchors patterns by default and exits with status 1 if no stdin input is provided.
Use --dense-threshold to adjust when near-contiguous character sets are collapsed into ranges
(accepts fractions.Fraction strings like 3/4 or 0.6; default when flag is present without a value:
8/10).
anchor_start=False or anchor_end=False.TrieRegexGenerator raises TypeError otherwise.TrieRegexGenerator builds a trie, minimizes it, and compacts ranges/quantifiers (using the density threshold for near-contiguous classes); it also accepts empty lines as valid examples.FAQs
Regex generator that derives optimized patterns from example strings.
We found that rector 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.