I would like to find all strings in files matching the pattern foo_*_bar
. I know that one can use \s
to match empty characters. What's the pattern for zero or more characters? Could not find it by searching the web.
1 Answer
After some experimentation, I discovered that the following works foo_[[:alnum:]]*_bar
. [[:alnum:]]
matches alphanumeric characters and *
matches the preceding item zero or more times, i.e. without *
the string foo__bar
does not match the pattern.