BASH_REMATCH
The bash array that holds the parts of a string matched by the last [[ =~ ]] regular expression test.
In more detail
Element 0 is the whole match and elements 1, 2 and so on are the capture groups. It is reset by every match, so copy values out before the next test.
Related terms
- IFS — The internal field separator: a shell variable listing the characters that word splitting and read cut text at.
Taught in
- The Cleanup That Emptied The Wrong Directory: Shell Scripts Under Exam Conditions — CompTIA Linux+ (XK0-006) Exam Prep