Last valid word before the cursor position

Gives the last valid word before the cursor position which is further used for autocomplete.