[^LIST] Negate Matching a Single Character In Specified List.

[^LIST] Negate Matching a Single Character In Specified List.

===> grep '^[^A-S]' fortunes

Words are the voice of heart

* UNIX was a Trademark of Bell Laboratories.

Writing free verse is like playing tennis with the net down.

The future isn't what it used to be!

The rain in Portugal falls mainly in the mountains.

The rain in Spain falls mainly in the plain.

Time is about the stream I go a-fishing in.

Three witches had three watches. Which witch was watching which watch?

You might have mail

The End

Previous slide Next slide Back to the first slide View Graphic Version

Notes:

This example illustrates the difference between using the ^ (circumflex) character to match at the beginning of a line; along with using the circumflex inside square braces to negate a single character range.

This expression states not to match the uppercase alpha-character ranging from A thru S from the beginning of the line. As you you will notice: lines 1, 6, 13, 30, 31, 32, 33, 34, and 36 satisfies this match from the fortunes file.