Are there any online grep tutorials that would feature some online tool for performing exercises? For example, having some predefined text sample and being told what patterns to find and so forth? It would be a very useful tool for practical learning of grep in a predictable environment.
Online grep exercises?
grep;regular expression;web;learning
If you're looking for an online environment to practice your pattern matching using regex, there are a number of nice resources that allow you to play around with expressions for a given portion of text. Off the top of my head, there is: regex pal or rubular.In terms of exercises, one idea is to search for questions tagged with [regex] on stack overflow. There are new regex questions of the form: I have this text, I want to match this part of it being posted all the time. You could just pick any one you feel comfortable with and try to work through it in your own time. There is also the benefit of being able to compare your solutions with the accepted answers.To get you started there is the regex site which has a variety of great resources.Note: although you asked about the grep command in particular, since it only utilises a subset of what regex has to offer in terms of pattern matching, I figured you would be better served focusing on regex in general. Also, there are varieties of grep that include a wider regex lexicon, such as egrep, which you might need to use eventually. See man grep for more details on its additional features/variations.