Pattern matching results. Can this equation be solved with whole numbers? I realize you said “read the bash man pages” but at first, I thought you meant read the man pages within bash. In the case of an empty list, the pattern did not match. The tutorial says that to turn the . site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. Shouldn't the {1} say "match exactly one space"? Networking With Bash; Parallel; Pattern matching and regular expressions; Behaviour when a glob does not match anything; Case insensitive matching; Check if a string matches a regular expression; Extended globbing; Get captured groups from a regex match against a string; Matching hidden files; Regex matching; The * glob; The ** glob; The ? To learn more, see our tips on writing great answers. Why does Steven Pinker say that “can’t” + “any” is just as much of a double-negative as “can’t” + “no” is in “I can’t get no/any satisfaction”? Character classes . The text ⌜minus⌟ matches nominus and minuses.But ⌜minus\b⌟ will not find minuses.If you search for exact word only, you may use ⌜\bminus\b⌟, this will ensure that each match will be connected with word’s start and end in the same time.. How to get the source directory of a Bash script from within the script itself? Why does Steven Pinker say that “can’t” + “any” is just as much of a double-negative as “can’t” + “no” is in “I can’t get no/any satisfaction”? message='123456789' echo "${message//[0-9]/*}" display ***** but. What are the earliest inventions to store and release energy (e.g. so your expression should be one of these: All together, your script can be like this: Digit notation \d doesn't work with your bash version. Do rockets leave launch pad at full thrust? One easy way to exclude text from a match is negative lookbehind: w+b(?