0

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 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.