A regular expression defines a pattern that matches a certain set of strings. For example, imagine you had the following set of strings :
Java is a programming language. My name is Fred. Java is fun. Yikes, it's not Java.
You could use the following regular expression to match all the strings that start with the word "Java":
Regular expressions have a specific syntax which can be used to build up a pattern. The above example can be broken into two different parts. Firstly the word "Java" specifies that the string must start with those four letters (case does matter e.g., the string "java is fun" would not be considered a match). The next two characters ".*" specify that zero or more characters can follow on in the string.