Matthew 5:27

25 Reconcile quickly with your adversary, while you are still on the way to court. Otherwise, he may hand you over to the judge, and the judge may hand you over to the officer, and you may be thrown into prison.

26 Truly I tell you, you will not get out until you have paid the last penny.

You have heard that it was said, ‘Do not commit adultery.’

28 But I tell you that anyone who looks at a woman to lust after her has already committed adultery with her in his heart.

29 If your right eye causes you to sin, gouge it out and throw it away. It is better for you to lose one part of your body than for your whole body to be thrown into hell.

Do read the surrounding verses too, because the context often says more than a single verse.

Compare

BSB
You have heard that it was said, ‘Do not commit adultery.’
KJV
Ye have heard that it was said by them of old time, Thou shalt not commit adultery:
WEB
“You have heard that it was said, ‘You shall not commit adultery;’
ASV
Ye have heard that it was said, Thou shalt not commit adultery:
DARBY
Ye have heard that it has been said, Thou shalt not commit adultery.
BLB
You⁺ heard that it was said, ‘You shall not commit adultery.’
ÅB
«Dere har hørt at det er sagt: ‘Du skal ikke drive hor.’
OTB
Dere har hørt at det ble sagt: ‘Du skal ikke bryte ekteskapet.’
B1930
I har hørt at det er sagt: Du skal ikke drive hor.

Study notes (Tyndale)

Original text and word study

Cross references