'A convenience method to create and return a new `SkyCoord` from the data
in an astropy Table.
This method matches table columns that start with the case-insensitive
names of the the components of the requested frames, if they are also
followed by a non-alphanumeric character. It will also match columns
that *end* with the component name if a non-alphanumeric character is
*before* it.
For example, the first rule means columns with names like
``\'RA[J2000]\'`` or ``\'ra\'`` will be interpreted as ``ra`` attributes for
`~astropy.coordinates.ICRS` frames, but ``\'RAJ2000\'`` or ``\'radius\'``
are *not*. Similarly, the second rule applied to the
`~astropy.coordinates.Galactic` frame means that a column named
``\'gal_l\'`` will be used as the the ``l`` component, but ``gall`` or
``\'fill\'`` will not.
The definition of alphanumeric here is based on Unicode\'s definition
of alphanumeric, except without ``_`` (which is normally considered
alphanumeric).  So for ASCII, this means the non-alphanumeric characters
are ``<space>_!"#$%&\'()*+,-./\:;<=>?@[]^`{|}~``).
Parameters
table : astropy.Table
The table to load data from.
coord_kwargs
Any additional keyword arguments are passed directly to this class\'s
constructor.
Returns
newsc : same as this class
The new `SkyCoord` (or subclass) object.'

@classmethod
def guess_from_table(cls, table, **coord_kwargs):

    inital_frame = coord_kwargs.get(u'frame')
    frame = _get_frame([], coord_kwargs)
    coord_kwargs[u'frame'] = inital_frame
    comp_kwargs = {}
    for comp_name in frame.representation_component_names:
        starts_with_comp = (comp_name + u'(\\W|\\b|_)')
        ends_with_comp = ((u'.*(\\W|\\b|_)' + comp_name) + u'\\b')
        rex = re.compile(((((u'(' + starts_with_comp) + u')|(') + ends_with_comp) + u')'), (re.IGNORECASE | re.UNICODE))
        for col_name in table.colnames:
            if rex.match(col_name):
                if (comp_name in comp_kwargs):
                    oldname = comp_kwargs[comp_name].name
                    msg = u'Found    at    least    two    matches    for        component    "{0}":    "{1}"    and    "{2}".    Cannot    continue    with    this    ambiguity.'
                    raise ValueError(msg.format(comp_name, oldname, col_name))
                comp_kwargs[comp_name] = table[col_name]
    for (k, v) in comp_kwargs.items():
        if (k in coord_kwargs):
            raise ValueError(u'Found    column    "{0}"    in    table,    but    it    was    already    provided    as    "{1}"    keyword    to    guess_from_table    function.'.format(v.name, k))
        else:
            coord_kwargs[k] = v
    return cls(**coord_kwargs)
