returns the start index of the last word of given string
(string)
| 207 | |
| 208 | |
| 209 | def last_word_pos(string): |
| 210 | """returns the start index of the last word of given string""" |
| 211 | match = forward_word_re.search(string[::-1]) |
| 212 | index = match and len(string) - match.end() + 1 |
| 213 | return index or 0 |
| 214 | |
| 215 | |
| 216 | @edit_keys.on("<Esc+b>") |