Use find posix-extended regexes instead of bash substring manipulation.