Ver Mensaje Individual
  #2  
Antiguo 15-02-2009
noob noob is offline
Miembro
 
Registrado: sep 2008
Posts: 212
Reputación: 16
noob Va por buen camino
Al final he hecho esto y funciona:

Código Delphi [-]
function IPIncorrecta(Cadena: string): boolean;
var
  ExpresionRegular: TRegExpr;
begin
  Result := True;
  ExpresionRegular := TRegExpr.Create;
  try
    ExpresionRegular.Expression := '^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){2}(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))$';
    if ExpresionRegular.Exec(Cadena) then
      Result := False;
  finally
    ExpresionRegular.Free;
  end;
end;

No se por qué la anterior no funciona correctamente.

Saludos.
Responder Con Cita