I am trying to write a regular expression for a scenario where -
user can enter a
string containing only a-z or A-Z and may end with a single .
The following are Words :
"ab", "ab."
The following are not Words :
"ab..", "a.b", ".ab", "a.b.", "a2b.", "."
I wrote
^([a-zA-Z]\\w(\\D+|\\.))$ but it is failing with the scenario of . in the mid.