You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhance(regex): improve IP extractor to prevent false positives and enforce IPv4 octet ranges
Tighten IPv4 pattern to enforce 0-255 per octet, rejecting invalid addresses like 256.256.256.256 and 999.999.999.999
Replace loose IPv6 matcher with comprehensive pattern covering full, compressed, link-local with zone IDs, and IPv4-embedded forms
Copy file name to clipboardExpand all lines: Specialized Areas/Regular Expressions/IP Address Validation/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
The regex in `getIP4OrIPV6address.js` validates both IPv4 and IPv6 addresses in input text.
1
+
This snippet extracts IPv4 and IPv6 addresses from free text. For single-value validation, see `validateIPInput.js` and `Validate IPv6 Address/script.js`.
2
+
3
+
The regex in `getIP4OrIPV6address.js` finds both IPv4 and IPv6 addresses within arbitrary text content.
2
4
3
5
IPv6 coverage includes:
4
6
- Full addresses like `2001:0db8:85a3:0000:0000:8a2e:0370:7334`
0 commit comments