May 23, 2024

Find Code by Syntax

ast-grep is a code tool for structural search and replace. It is like syntax-aware grep/sed! You can write code patterns to locate and modify code, based on AST, in thousands of files, interactively.

they give this example: sg -p '$A && $A()' -r '$A?.()'

see also: ripgrep, fastmod

↑ up