Try this.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
$hGui = GUICreate("My GUI edit")
$IP = GUICtrlCreateInput("", 10, 15, 200, 22)
$IP2 = GUICtrlCreateInput("", 10, 40, 80, 22)
GUICtrlCreateLabel("<- Digits and dots only.", 215, 15, 200, 22)
GUICtrlSetFont(-1, 12)
GUICtrlCreateLabel('<- "n.nn.nnnn.n" pattern only.', 95, 40, 300, 22)
GUICtrlSetFont(-1, 12)
GUISetState()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Func WM_COMMAND($hWnd, $msg, $wParam, $lParam)
$nNotifyCode = BitShift($wParam, 16)
$nID = BitAND($wParam, 0x0000FFFF)
If $nID = $IP Then ; Only digits and dots
If $nNotifyCode = $EN_CHANGE Then
GUICtrlSetData($IP, StringRegExpReplace(GUICtrlRead($IP), "[^0-9.]+", ""))
EndIf
EndIf
If $nID = $IP2 Then ; Allow n.nn.nnnn.n characters only - where n is a digit. For example 2.15.1598.1 is allowed.
If $nNotifyCode = $EN_CHANGE Then
$temp2 = GUICtrlRead($IP2)
$REPattern = "\d\.\d\d\.\d\d\d\d\.\d"
$iLen = StringLen($temp2)
If StringRegExp($temp2, StringLeft($REPattern, $iLen * 2)) = 0 Or $iLen > 11 Then GUICtrlSetData($IP2, StringTrimRight($temp2, 1))
EndIf
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND