That's not the correct wording, it is one of many translations into English of the correct wording, which is in ancient koine Greek.
For some of the many other translations.
http://bible.cc/matthew/26-52.htm
I know of no translation that says "live by the sword."
What is the correct wording?