I try to remove dot only from end of each word in given text. (in java) for example:
input: java html. .net node.js php. output: java html .net node.js php
If you're going to use a regular expression, I'd recommend using a word boundary.
\.\B
This matches a literal dot at the end of a word boundary only.