Since only the first 3 characters for the English-language mnemonic matter, I prefer to reduce the words to just the first 3 letters only, for cold storage purposes. I would like to do this with a regular expression, to avoid manual errors.
What would be the shortest regular expression to do this? Note that I want a newline at the end. I will post my current solution, looking forward to see a shorter one.
echo "${MNEMONIC}" | ruby -e "puts ARGF.read.gsub(/(\w{3})\w*/,'\1')". Can't get the other one to work in Ruby though. Thanks also for the regex101.com examples. – dpzz Nov 15 '16 at 18:38