metavariable

A placeholder in a Semgrep pattern, written as a dollar sign and capital letters such as $X, that matches any expression.

In more detail

A pattern such as $X.execute(...) matches the call whatever the variable is named. If the same metavariable appears twice, both places must hold the same expression.

Example

$CUR.execute("..." % ...) matches SQL built with % formatting on any cursor

Related terms

Taught in

References