Regexp. How to match word isn't followed and preceded by another characters

Viewed 895

I want to replace mm units to cm units in my code. In the case of the big amount of such replacements I use regexp.

I made such expression:

(?!a-zA-Z)mm(?!a-zA-Z)

But it still matches words like summa, gamma and dummy.

How to make up regexp correctly?

2 Answers
Related