Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixing IPv6AddressRegExp
  • Loading branch information
zaelgohary committed Sep 14, 2022
commit 7d2a8b4d285bb43bf1aeea6b887ed2cee49a57ab
2 changes: 1 addition & 1 deletion src/lib/isIP.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const IPv6AddressRegExp = new RegExp('^(' +
`(?:${IPv6SegmentFormat}:){2}(?:(:${IPv6SegmentFormat}){0,3}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,5}|:)|` +
`(?:${IPv6SegmentFormat}:){1}(?:(:${IPv6SegmentFormat}){0,4}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,6}|:)|` +
`(?::((?::${IPv6SegmentFormat}){0,5}:${IPv4AddressFormat}|(?::${IPv6SegmentFormat}){1,7}|:))` +
')(%[0-9a-zA-Z-.:]{1,})?$');
')([0-9a-fA-F]{1})?$');

export default function isIP(str, version = '') {
assertString(str);
Expand Down