A regular expression is a set of characters that define a pattern used to match character combinations in strings. It is very powerful for finding and replacing strings/substrings in a document. Using regular expression enables you to find and extract data from a big text document with little effort and to extract exception or errors from big logs. Regular expression can also help when validating data provided from the user, i.e. passwords, emails, phone numbers, etc.