experimenting with generic functions to solve aglob/regex issue