egrep
all
Find patterns in files using extended `regex`es. Note: This command is an alias of `grep --extended-regexp`.
More info →Examples (8)
Search for one or more repeated characters
egrep 'a+' path/to/fileSearch for zero or one occurrences of a character (optional match)
egrep 'a?' path/to/fileSearch for 10 repetitions of a character
egrep 'a{10}' path/to/fileSearch for 3 to 7 repetitions of a character
egrep 'a{3,7}' path/to/fileSearch for one of the listed options
egrep 'cat|dog|mouse' path/to/fileSearch for one of the listed options inside a larger pattern
egrep 'c(a|o|u)p' path/to/fileSearch for a group of characters repeating one or more times
egrep '(aeiou)+' path/to/fileSearch using standard character classes (more info: <https://www.regular-expressions.info/posixbrackets.html>)
egrep [[:alnum:|:alpha:|:space:|...]] path/to/filemade by @shridhargupta | data from tldr-pages