C# Class Canonicalize.Strategies.PatternStrategy

URL canonicalization strategy using a pattern described as a regular expression to modify the path.
Inheritance: IUrlStrategy
Datei anzeigen Open project: schourode/canonicalize Class Usage Examples

Public Methods

Method Description
Apply ( UriBuilder uri ) : void

Matches the path of the URL against the pattern and assigns the replacement string (with substitutions) if matching.

PatternStrategy ( string regex, string replacement ) : System

Initializes a PatternStrategy with a specific regular expression and replacement string.

Method Details

Apply() public method

Matches the path of the URL against the pattern and assigns the replacement string (with substitutions) if matching.
public Apply ( UriBuilder uri ) : void
uri System.UriBuilder The URL to be canonicalized.
return void

PatternStrategy() public method

Initializes a PatternStrategy with a specific regular expression and replacement string.
public PatternStrategy ( string regex, string replacement ) : System
regex string The regular expression applied to the path.
replacement string Replacement string applied on match.
return System