awk is a programming language found on any UNIX system handy for processing text files. It is handy like grep, powerful like sed, and has actual variables and statements, but not as unwieldy as perl. A full description of it would be out of scope here.
match() is a function that returns a positive number if the regular expression is found inside the line( i.e. $0 ). If it returns anything positive, then the code block following it inside { } is executed.
RSTART and RLENGTH are variables that tell where the string is found, match() sets them.
substr() is used to extract the string. substr($0, RSTART, RLENGTH) would extract the whole thing, just like egrep. Adding to RSTART and subtracting from RLENGTH excludes the tag portion.
Lastly, print prints.
Here's an old post of mine if you want to explore awk more
in depth.