I'd like to know if this regex expression is correct for checking that a string doesn't start with a dot, doesn't end with a dot and contains at least one dot anywhere but not the start or end:
My issue is that I can't figure on how to check if there's 2 dots in a row.
/^([^.])+([.])+.*([^.])$/
if (preg_match('~^[^.]+(?:\.[^.]+)+$~', $s, $matches)) { /* VALID! */ }. The 3rd$matchesargument is actually not necessary.