InRegex Logo
InRegex
Nuovo

Match IP Address in JavaScript

Spiegazione

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

Espressione Regolare

\b(?:\d{1,3}\.){3}\d{1,3}\b
Copia
javascript

Esempio di Utilizzo

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

Espressioni Regolari Simili