Skip to content

Commit

Permalink
net: v4Seg should use different order of elements in RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Sep 8, 2023
1 parent b50cc03 commit 5dcb140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const { writeBuffer } = internalBinding('fs');
const errors = require('internal/errors');

// IPv4 Segment
const v4Seg = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
const v4Str = `(?:${v4Seg}[.]){3}${v4Seg}`;
const v4Seg = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])';
const v4Str = `(?:${v4Seg}\.){3}${v4Seg}`;
const IPv4Reg = new RegExp(`^${v4Str}$`);

// IPv6 Segment
Expand Down

0 comments on commit 5dcb140

Please sign in to comment.