BRE's need to escape () {} and can use \n as the nth backreference ^ first character on line $ last character on line . matches any single character * matches preceding element 0 or more times {m/n} matches preceding element at least m and no more than n times ? matches preceding element 0 or 1 times (ERE only) + matches preceding element 1 or more times (ERE only) | or operator (ERE only) [ ] matches any single character in brackets (a-z, A-Z, 0-9... allowed for character ranges) [^ ] matches any single character not in brackets ( ) sub-expression Character classes: [:alnum:] alphanumeric [A-Za-z0-9] [:alpha:] alphabetic [A-Za-z] [:blank:] space and tab [:cntrl:] control characters [:digit:] numbers [0-9] [:graph:] visible characters [:lower:] lowercase letters [:upper:] uppercase letters [:print:] visible and space characters [:punct:] punctuation characters []!"#$%^&'()*+,./:;=<>?\@`{}|~-_ [:space:] whitespace characters [:xdigit:] hexadecimal digits [A-Fa-f0-9]