Skip to content

Instantly share code, notes, and snippets.

@sivaprabug
Last active January 12, 2017 13:37
Show Gist options
  • Select an option

  • Save sivaprabug/96ba3d0554e9086d80cd963995eb883a to your computer and use it in GitHub Desktop.

Select an option

Save sivaprabug/96ba3d0554e9086d80cd963995eb883a to your computer and use it in GitHub Desktop.
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