import re


def is_file_pattern(text):
    """
    >>> is_file_pattern('file.java')
    True
    >>> is_file_pattern('.gitignore')
    True
    >>> is_file_pattern('file')
    False
    >>> is_file_pattern('java')
    False
    >>> is_file_pattern('*.java')
    True
    >>> is_file_pattern('docs/Makefile')
    True
    >>> is_file_pattern('**/*.jpg')
    True
    >>> is_file_pattern('.rubocop.yml')
    True
    >>> is_file_pattern('Class.{h,cpp}')
    True
    """
    return bool(re.match(r'''
        (?: [.]{0,2}[\-_*\w+]+ /)*  # Preceeding directories, if any
            [.]?[\-_*\w+]+          # The basename

        (?: [.][\-_*\w]+            # An extension
          | [.][{][^}*,]+,[^}*]+[}] # An alternation
          | (?: file | ignore ))    # .gitignore, Makefile
    ''', text, re.VERBOSE | re.UNICODE))