I have a string that can either be something like
create
or
create by
depending on the verb, etc. In Ruby (on Rails) to get the past tense
string.sub(/e?$/, "ed")
or
string.sub(/ by?$/, "ed by")
works, but is there any way to combine the two? With some type of conditional statement or similar.