InRegex Logo
InRegex
Nuevo

Match IP Address in JavaScript

Explicación

This regex pattern matches an IP address in the format 'xxx.xxx.xxx.xxx', where each 'xxx' can be a number between 0 and 255. The '\b' ensures that the match is a whole word.

javascript

Expresión Regular

\b(?:\d{1,3}\.){3}\d{1,3}\b
Copiar
¿Tienes Comentarios?
javascript

Ejemplo de Uso

const regex = /\b(?:\d{1,3}\.){3}\d{1,3}\b/;
const ipAddress = '96.0.0.1';
console.log(ipAddress.match(regex));
Copiar

Expresiones Regulares Similares