Skip to content

Instantly share code, notes, and snippets.

@latagore
latagore / ipv6-regex-test.sh
Last active June 29, 2016 23:18 — forked from syzdek/ipv6-regex-test.sh
Test IPv6 regular expression without dependency on custom scripts
#!/bin/sh
#
test_regex () {
REGEX="$1";
TEST_STRINGS="$2";
[ -n "$3" ] && [ "$3" = "expect_no_match" ] && SHOW_NON_MATCHING="-v";
# find IP addresses anywhere in the string
# but avoid certain characters in the beginning and end