Data <- c("Posted by ondrej on 29 Feb 2020."
, "Posted by ona'je on 29feb 2020")
sub(" +?on.*$", "", Data) # "Posted by ondrej" "Posted by ona'je"
sub(" +?on.*", "", Data) # "Posted bydrej on 29 Feb 2020." "Posted bya'je on 29feb 2020"
sub(" +?on(.*)", "", Data) # as expected
sub(" +on.*", "", Data) # as expected
RGF0YSA8LSBjKCJQb3N0ZWQgYnkgb25kcmVqIG9uIDI5IEZlYiAyMDIwLiIKLCAiUG9zdGVkIGJ5IG9uYSdqZSBvbiAyOWZlYiAyMDIwIikKCnN1YigiICs/b24uKiQiLCAiIiwgRGF0YSkgICMgIlBvc3RlZCBieSBvbmRyZWoiICJQb3N0ZWQgYnkgb25hJ2plIgpzdWIoIiArP29uLioiLCAiIiwgRGF0YSkgICAjICJQb3N0ZWQgYnlkcmVqIG9uIDI5IEZlYiAyMDIwLiIgIlBvc3RlZCBieWEnamUgb24gMjlmZWIgMjAyMCIKc3ViKCIgKz9vbiguKikiLCAiIiwgRGF0YSkgIyBhcyBleHBlY3RlZApzdWIoIiArb24uKiIsICIiLCBEYXRhKSAgICAjIGFzIGV4cGVjdGVkCgo=