in reply to Re: Check last character of a stringin thread Check last character of a string
perl -wMstrict -le "for (@ARGV) { print; s{ (?<! \\) $ }'\\'xms; print } " with\ sans with\ with\ sans sans\ [download]