I am using the PHP to run a regex on some strings.
The strings looks like:
somethingsomethin.somethingsomething.extension
I want to match the bits between the 2 periods and including the 2 periods part in the above:
.somethingsomething.
I came up with something simple like: \..+\.
The problem is that it matches all the periods in something like this:
somethingsomethin....somethingsomething....extension matches as ....somethingsomething.... when I only want .somethingsomething..
How can I get my regex expression to match as “1 unit” and to match only once?
Since
.matches a., exclude literal.s:\.[^.]+\.or possibly\.\w+\..