You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often use Semgrep inline patterns (semgrep --lang=<lang> --pattern='<pattern>' ./) for finding certain simple patterns in codebases (similarly to https://github.com/weggli-rs/weggli).
It would be awesome if the CLI would support passing in metavariable regexes through a flag (or multiple flags). If this is already allowed, I haven't found it (and then I would suggest improving the semgrep --help).
I found there is a way to hack this around, at least for matching strings via regex via the deprecated feature: https://semgrep.dev/docs/writing-rules/pattern-syntax#string-matching -- so that we can do something like semgrep --lang=go --pattern='"=~/^http://[^1]/"' ./. However, it would be nice to have a way to pass metavariable regexes in the long term.
The text was updated successfully, but these errors were encountered:
Hi,
I often use Semgrep inline patterns (
semgrep --lang=<lang> --pattern='<pattern>' ./
) for finding certain simple patterns in codebases (similarly to https://github.com/weggli-rs/weggli).It would be awesome if the CLI would support passing in metavariable regexes through a flag (or multiple flags). If this is already allowed, I haven't found it (and then I would suggest improving the
semgrep --help
).I found there is a way to hack this around, at least for matching strings via regex via the deprecated feature: https://semgrep.dev/docs/writing-rules/pattern-syntax#string-matching -- so that we can do something like
semgrep --lang=go --pattern='"=~/^http://[^1]/"' ./
. However, it would be nice to have a way to pass metavariable regexes in the long term.The text was updated successfully, but these errors were encountered: