How to find out whether a file exists with the help of regular expression?

Hi all
I have a list of file names in array. But this file names are not exact. so i want to search whether a file exists or not using regular expression.
code snippet:

if [ -f "*EQST*" ];
then
echo "File exists"
else
echo "File does not exits"
fi

over here "*EQST*" should be treated as a regular expression. and the Actual file name in the directory will be something like 'Exp_BK_FT_T_EQST.txt'.

So how should i do this?
The above could is taking *EQST* as a string and trying to search with the same name.

TIA
Regards
Ganesh

---------- Post updated at 02:51 PM ---------- Previous update was at 02:45 PM ----------

Hey got it no need to reply. i just had to remove the double quotes from the if clause.

Thanks & Sorry
Ganesh

You didn't specify which shell you're using.
With most modern Bourne type shells (zsh, bash, ksh93) you could do something like this:

_files=( *EQST* )
(( ${#_files[@]} )) && echo 'file(s) exist'

That won't work if more than one file matches the pattern.

Generally, that won't work either. If the pattern goes unmatched, it remains unmodified and will be assigned to the array as is. If there is no match, the array will have 1 member. If one file matches, the array will also have 1 member. If many files match, the array will have more than 1 member. In all cases, the subsequent test will evaluate to true.

Some shells can be told to replace unmatched patterns with a null string (e.g. bash's shopt -s nullglob ), but this is not the default, standard-compliant behavior.

Regards,
Alister

Absolutely right, Alister!
Thanks for pointing this out!

For zsh: setopt nullglob or your_pattern(N) .
For ksh93: ~(N)your_pattern .

In some cases dotglob could also be desirable.

If none of the above shells is available:

for f in *EQST*; do
  if [ -e "$f" ]; then 
    echo exist  
    break
  fi
done