







![]() ![]() |
C# Webserver |
RegexRedirectRule Constructor (String, String, RegexOptions) |
RegexRedirectRule Class Example See Also Send Feedback |
Initializes a new instance of the RegexRedirectRule class.
Namespace:
HttpServer.Rules
Assembly:
HttpServer (in HttpServer.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public RegexRedirectRule( string fromUrlExpression, string toUrlExpression, RegexOptions options ) |
Visual Basic (Declaration) |
---|
Public Sub New ( _ fromUrlExpression As String, _ toUrlExpression As String, _ options As RegexOptions _ ) |
Visual C++ |
---|
public: RegexRedirectRule( String^ fromUrlExpression, String^ toUrlExpression, RegexOptions options ) |
Parameters
- fromUrlExpression
- Type: System..::.String
Expression to match url
- toUrlExpression
- Type: System..::.String
Expression to generate url
- options
- Type: System.Text.RegularExpressions..::.RegexOptions
Regular expression options to use, can be null
Examples
server.Add(new RegexRedirectRule("/(?<first>[a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase));
Result of ie. /employee1 will then be /user/employee1