Regular Expression Examples

Expression Explanation
.* matches 0 or more of any character
Which match? abc xD0-2 Abc#

Expression Explanation
f* matches 0 or more fs.
Which match? f afe 1-$3[

Expression Explanation
ff[^a-d] matches two fs followed by any character that is not between a and d
Which match? fad Fxy fffaxd
  Ffbxef9 99f rl-f ff

Expression Explanation
^ff*[a-d^+] matches an f at the begining of a line followed by 0 or more fs followed by any character between a and d, or a ^, or a +.
Which match? fxdrfab xxfff+ ffffb
  fxfv-gf^ f- ff

Expression Explanation
^$ a blank line
Which match? (a line with nothing on it)
	
(a line with just a tab on it)
  	 	
(a line with 2 spaces, a tab, a space, and a tab)

Expression Explanation
[Ff][a-d] matches F or f followed by any character between a and d
Which match? fad Fxy ffffaxd
  fab fFd Xfxaf