import re

text = 'the house is big the house is big the house is big'
char_nr = 19
pattern = rf"\S.{{0,{char_nr - 1}}}(?!\S)"

strings = re.findall(pattern, text)

print(strings)

list_of_words_before = strings[1].split()
print(list_of_words_before)

nr_words = 3
lenOfWordsBefore = len(list_of_words_before)
if nr_words > lenOfWordsBefore:
    nr_words = lenOfWordsBefore

print(list_of_words_before[-nr_words:])