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.
Asked
Active
Viewed 32 times
0

Drew
- 75,699
- 9
- 109
- 225

honey_badger
- 181
- 2
- 8
1 Answers
0
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.

honey_badger
- 181
- 2
- 8