This should really be inside of Cursor, something like
getPreviousBoundaryBuffer(boundary: Regex, breakOnStartOfLine: false)
Iterates characters previous to current cursor position until a boundary is been hit.

Because I need to use this again in another package, but I cannot make this happen. @kevinsawicki ?