Need little help with ending swash.


Hi! My very first post - logged in because of this question.
I want to make the following rule in OT font:

(in human language) If the word ends with "r", it should be substituted with "r.alt"

So far I've been trying to understand FL manual, search this forum and google for tutorials, but with no luck at all.