A regex is a regular expression. It's used for matching text. For example, if you had a hundred street addresses and you wanted to find all the addresses that were on main street, you couldn't just say, "If $address=="main street" because many of them would be like this:
123 main street
24 main street apt. 56a
So with regular expressions, you can say, "Does the string start with a few numbers followed by a space and then followed by the word "main" followed by a bunch of other stuff?"
That regex might look like this: /[0-9]+ main.+/
As for detailed information, Google is your friend.