import re


def get_word_under_cursor(buffer, row, col):
    """
    >>> buf = ['select count(*) from db.test;', '', '    ']
    >>> get_word_under_cursor(buf, 0, 3)
    'select'
    >>> get_word_under_cursor(buf, 0, 6)
    'select'
    >>> get_word_under_cursor(buf, 0, 7)
    'count(*)'
    >>> get_word_under_cursor(buf, 0, 23)
    'db.test;'
    >>> get_word_under_cursor(buf, 1, 0)
    ''
    >>> get_word_under_cursor(buf, 2, 0)
    ''
    """
    line = buffer[row]
    for word in re.finditer(r'\S+', line):
        if col >= word.start() and col <= word.end():
            return word.group(0)
    return ''