text and other languages It’s a mini language of its own, with syntax rules Regular Expressions are a power tool for solving text related problems Thursday, December 22, 2011
grep/egrep filters its input based on regular expressions more/less/most search uses regular expressions vi/vim search and replace use regular expressions Thursday, December 22, 2011
use any character sequence inside the squares [012], [abc], [aAbBcZ] Can use ranges inside the squares [0-9], [a-z], [a-zA-Z], [0-9ab] Thursday, December 22, 2011
\s (\S) - match a white space (or other) \d (\D) - match a digit (or other) cheat sheet at: http://www.petefreitag.com/cheatsheets/regex/character-classes/ Thursday, December 22, 2011
means match one or more times ? means match zero or one time {n,m} means match at least n but no more than m times {n} means match exactly n times Thursday, December 22, 2011
on adding matches to the quantified element as long as possible If a match failure occurs later on, the engine will backtrack Thursday, December 22, 2011