I have a BASH script that allows a user to specify a jobname. Right now we except everything. We feed this jobname into another executable that can only accept the following formats:
job_name, jobname, job-name, job_name1, job-name1, jobname1, job_name[1-5] job-name[1-5] or jobname[1-5] or other permutations that are alphanumeric (case sensitive) and [, ], _, -
I'm looking for way to trap the name and reject anything that doesn't follow that format. Started trying to use the regex with if statement but the  seem to be throwing me for a loop.