Created
January 24, 2024 18:30
-
-
Save FanchenBao/5bd7eedc4889032df6c62c95062d1ae8 to your computer and use it in GitHub Desktop.
ggrep recipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ggrep is the GNU grep. On macOS, it is installed via `brew install grep` | |
# Using perl regex for lookahead and lookbehind | |
# This example greps the EXACT match between quotation marks | |
aws lambda publish-version --function-name foo --profile bar | ggrep -Po '(?<=")\d+(?=")' | |
# This example counts the number of occurrences of "prod" that is wedged bewteen string literals | |
# '"Name": "' and '"' | |
aws lambda list-aliases --function-name foo --profile bar | ggrep -Pc '(?<="Name":\s")prod(?=")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment