< Back

IPv6Regex

Wed Jan 15, 2020 7:43 am

NAME IPv6Regex



SYNOPSIS

Tests IPv6 Regex patterns against a large number of sample test addresses.





SYNTAX

IPv6Regex [[-TestName] <Object>] [-NoFormat] [<CommonParameters>]





DESCRIPTION

This function tests a number of IPv6 regexs against a selection of valid and invalid

IPv6 addresses to verify that the regexs perform as expected. The function also tests

the sample addresses using the [System.Net.IpAddress]::TryParse() method to illustrate

the performance and conformance of this method.





PARAMETERS

-TestName <Object>

If specified, only run tests with names matching this.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NoFormat [<SwitchParameter>]

Provide raw output objects for each test. The default is to select only failing test

result objects and to format the resulting output. Use this parameter if you wish to

use a different selection or formatting option to the default provided here.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None





OUTPUTS

By default, outputs formated table of failing tests. Use -NoFormat to output raw objects.





NOTES





The script will time the relative performance of the various regexs; use the -Verbose

switch to display the timimg information.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>IPv6Regex



Run all tests and display those that fail.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>IPv6Regex -Verbose



Run all tests; additionally display relative performance timings.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>IPv6Regex -TestName 'compiled'



Only run tests where the test name includes the string 'compiled'.









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>IPv6Regex -NoFormat



Run all tests and output a raw RegexMatchResult object for each test.











RELATED LINKS

http://github.com/ChrisWarwick/IPv6Regex