$ # + K Regular Expressions
A regular expression is formed by stringing together characters with or without operators. The simplest regular expressions are strings of text characters with no operators at all:
	apple
	orange
These two regular expressions match any occurrences of those character strings in a text file.

The regular expression operators are:
	| ^ $ . * + ? ( ) [ ] { } \

These have the following meanings.
	
.	any character but new-line	
^x	x at the beginning of the line	
x$	x at the end of the line	
[xy]	x or y	
\x	x, if x is an operator 	
[^x]	any character but x	
[x-z]	x, y or z	
x?	optional x 	
x*	0, 1, 2,... instances of x	
x+	1, 2, 3,... instances of x	
x{m,n}	m through n occurences of x	
xx|yy	xx or yy	
(x)	x	
"xy"	xy, even if x or y are operators (except \)	
Examples of Regular Expressions

abc
matches any line of text containing the three letters 'abc' in that order
a.c
matches any string beginning with the letter 'a' followed by any character followed by the letter 'c'.
^.$
matches any line containing exactly one character (the newline is not counted)
a(b*|c*)d
matches any string beginning with a letter 'a followed by either zero or more of the letter 'b' or zero or more of the letter 'c' followed by the letter 'd'
.* [a-z]+ .*
matches any line containing a word consisting of lower case alphabetic characters delimited by at least one space on each side.
(morty).*\1
morty.*morty
The above expressions both match lines containing at least two occurences of the string 'morty'