srgn
Share on:
Enter Your Mastodon Instance
Copy the link below to share to Mastodon
https://terminaltrove.com/srgn/
A syntax‑aware grep alternative with code edits.
pacman -S srgn

srgn is a code‑aware replacement for grep
, tr
and sed
. It fuses regular expressions with tree‑sitter parsing to let you search and refactor source code safely.
Key features of srgn include syntax-aware searching, allowing users to locate code patterns based on structure rather than text. It supports multiple programming languages and can be used for code refactoring or rewriting specific constructs.
This tool also has customizable queries, parallel processing, replacing text with capture variables, delete, squeeze repeats, switch case, unicode support and even converts german characters (e.g. Ä to 'Ae' or 'AE'). Other features include bulk edits, --glob
rewrites and coloured diffs.