Hello,
I am searching all over the place for this, just not finding anything solid
I want to do be able to access the groups that are matched with grep (either with extended regex, or perl compatible regex). For instance:
echo "abcd" | egrep "a(b(c(d)))"
Of course this returns "abcd", but I would like to have access to each regex group that matched as well. In just bash, I believe there is a SUBMATCH array, but it seems to not be set in this case.
Any help would be greatly appreciated! Thanks!!