Interests: Regular Expressions, Linux CLI one-liners, Scripting Languages and Vim
Regex syntax and features vary between implementations. \d
isn’t supported by BRE/ERE flavors.
GNU grep
supports PCRE, so you can use grep -oP '/dev/loop\d'
or grep -o '/dev/loop[0-9]'
if you are matching only one digit character.
Why would it print the colon?