Skip to content

Instantly share code, notes, and snippets.

@kbbgl
Created May 7, 2020 16:58
Show Gist options
  • Save kbbgl/c7d29732103278580178090ea923bac5 to your computer and use it in GitHub Desktop.
Save kbbgl/c7d29732103278580178090ea923bac5 to your computer and use it in GitHub Desktop.
[match chunks 0+ times] #regex
# match 0 or more times using * quantifier
echo "hello, how are you?" | grep -e "[a-z]*" # will match hello, how, are, you
# match all numbers in chunks with length of one or more with + quantifier
echo "47427 8381481 5813471" | grep -P "[0-9]+"
echo "47427 8381481 5813471" | grep -P "\d+"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment