Sed is its on mini language, but it is most often used to search and replace text. Suppose you had a bunch of files each containing occurrences of a string that needed to be changed. You obviously don't want to open each file and edit them individually, so you turn to sed. For this example, we'll change a string "enabled=false" to "enabled=true". The syntax for search and replace is s/match/replace/g. The 'g' at the end is optional and stands for global, meaning it will search and replace throughout the entire file, rather than just the first match it finds.
Code:
$ cd /path/to/files
$ find . | sed -i 's/enabled=false/enabled=true/g'
By using the -i option to sed, it will edit the file in place. This is a destructive operation, so back up the files beforehand.

That's easy enough, what if you don't want to change every ocurrence of a string? Maybe you have a css file and you want to change the background color of some, but not all classes.

For the example below we'll change the background color of a css class called sidebar. The tricky part is that we want to start out by matching ".sidebar", but want the actual substitution to match below that line. At the same time, we don't want to modify anything outside of that class.

When this happens, define an address before your substitution command. Addresses can be numbers representing lines in a file or they can be text patterns, and they can also be ranges between one pattern or line number to another. To define a range within which to edit, define the address as two patterns separated by commas. This pattern will be /^\.sidebar/,/}/ meaning "find the string .sidebar at the beginning of a line (^), then go until you see the next }".

Code:
//Original text
.sidebar {
    float: left; text-align: left;
    padding-left: 15px;
    background-color:  #FF7F50;
    border-left: 1px dotted #ddd;
}
Here is the complete command that will make the change.
Code:
$ cat layout.css | sed '/^\.sidebar/,/}/  s/background-color:.*\;/background-color:\ #3CB371\;/g' > newlayout.css
Code:
//Modified text
.sidebar {
    float: left; text-align: left;
    padding-left: 15px;
    background-color: #3CB371;
    border-left: 1px dotted #ddd;
}
If all of this looks like gibberish, it will become clearer after you have become familiar with the rules for regular expressions. There are lots of places to learn about them, including the info page for sed (enter 'info sed' on the command line to read it). There is a website dedicated to regular expressions at http://www.regular-expressions.info/.