I need a regular expression that will match any string containing at most 2 dashes and 2 dots.
There does not HAVE to be a dash nor a dot, but if there is 3+ dashes or>
$re = '/# Match string with 2 or fewer dots or dashes
^ # Anchor to start of string.
(?=[^.]*(?:\.[^.]*){0,2}$) # Assert 2 or fewer dots.
(?=[^\-]*(?:-[^\-]*){0,2}$) # Assert 2 or fewer dashes.
.* # Ok to match string.
$ # Anchor to end of string.
/sx';