Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove [ and ] in ipv6 address using JavaScript
<!DOCTYPE html>
<html>
<head>
<title> Remove [ and ] in ipv6 address using JavaScript</title>
<h1 align="center"><u> Remove [ and ] in ipv6 address using JavaScript</u></h1>
<script>
var ipv6 = '[2001:0db8:0000:0000:0000:ff00:0042:8329]';
// var ipv6 = '10.0.124.75';
ipv6 = ipv6.replace(/[\]\[]/g, '');
console.info('ipv6', ipv6);
</script>
</head>
<body>
<div align="center">
</div>
<ol>
</ol>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.