Join David D. Levine for an in-depth discussion in this video Regular expression basics, part of AWK Essential Training.
- View Offline
…If you're going to use AWK for any kind of…real world task, you'll very quickly find yourself using regular expressions.…Regular expressions are used throughout the…UNIX world, and in many other contexts.…They're covered in detail in the course, Using Regular Expressions.…But for now, I'm just going to give you…a quick introduction, in case you haven't encountered them before.…A regular expression is a special kind of string.…That defines a pattern, which other strings are said to match, or not match.…Regular expressions in AWK, are usually written between slashes.…
But in some circumstances you can use a…string, written between quotes, as a regular expression.…As with the conversion of numbers to strings and…vice versa, a string, is converted to a regular expression.…If you use it where regular expression is expected.…The most basic regular expression is a simple string, like slash abc slash.…The pattern abc, matches any other string which contains the letters…a, b, and c, in that order with nothing in between them.…
In this course, award-winning author and teacher David D. Levine shows you how to use AWK to read and write data in a variety of formats, produce reports, and automate repetitive tasks. He reviews the nuts and bolts of the language, such as field separators, pattern matching, variables, operators, expressions, and control structures; functions available for manipulating data; and integration with other programs like Excel.
- What is AWK?
- Writing an AWK program
- Working with records, fields, patterns, and actions
- Specifying field and record separators with variables
- Using built-in and user-defined variables
- Building control structures
- Formatting output
- Manipulating string data with functions
- Scripting with AWK