Regex - invalid string when two periods in string

I’m trying to come up with a regex that will follow these rules:

Valid:
part1.partdos.section3
section2.part3
fullstring

Invalid:
.part1.partdos.section3
part1.partdos.section3.
part1…partdos.section3
part1.partdos…section3

Here’s the regex I have so far:

^[^/.][a-z0-9/.]+[^/.]$

The part I can’t figure out is how to make the match invalid when there is more than one period together in the string.

Ideas? Thanks :slight_smile:

Ah ha, got it.

I walked away for a bit and started thinking through with a different approach, and ended up with this:

^[^/.](?:[./]?[a-z0-9]+)+$