-
-
Save kbbgl/c7d29732103278580178090ea923bac5 to your computer and use it in GitHub Desktop.
[match chunks 0+ times] #regex
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
# 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