From a97dcf2a3b70973a0b12f9ea9d700ca6388ce46a Mon Sep 17 00:00:00 2001 From: Linus G Thiel Date: Tue, 3 May 2022 21:54:42 +0200 Subject: [PATCH] Use equivalent regex with PCRE Use the equivalent regex with PCRE. `[0-9]*` (and `\d*`) will output each integer, e.g.: ```bash echo 17 | grep -o '[0-9]*' ``` Whereas `\d` will split it into digits, e.g.: ```bash echo 17 | grep -oP '\d' ``` Signed-off-by: Linus G Thiel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47fc319..8042968 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,7 @@ grep -c "^$" ```bash grep -o '[0-9]*' #or -grep -oP '\d' +grep -oP '\d*' ``` ##### Grep integer with certain number of digits (e.g. 3) ```bash