I want to allow alphanumeric characters and periods; however, a phrase cannot contain more than two or more periods in a line, it cannot begin or end with a period, and spaces are not allowed.
I am using PHP and Javascript.
I still have /^(?!.*\.{2})[a-zA-Z0-9.]+$/
This works to resolve alphanumeric characters and periods, while at the same time negating spaces and consecutive periods, but I'm still not sure how to check the start and / or end periods. How can i do this? and is there an even better way to do what I already have?
Johnz source share