RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<=[-{1,2}|/])(?<name>[a-zA-Z0-9]*)[ |:|"]*(?<value>[\w|.|?|=|&|+| |:|/|\\]*)(?=[ |"]|$)
Description
Parses command line strings into name value pairs
Matches
-path:c:\test path\temp -param "spaced string" -x
Non-Matches
"this is a non matched string"
Author Rating: The rating for this expression. Gavin Hay
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: param 1 or 2 doesn't works
Name: Anon
Date: 10/20/2011 10:33:38 AM
Comment:
this command lines doesn't works: consoleaplication -param 1 consoleaplication -param 2 but consoleaplication -param 3 <- it works Example: Dim col As RegularExpressions.MatchCollection = Regex.Matches(argStr, _ "(?<=[-{1,2}/])(?<name>[a-zA-Z0-9]*)[ |:|""]*(?<value>[\w|.|?|=|&|+| |:|/|\\]*)(?=[ |""]|$)", RegexOptions.IgnoreCase Or RegexOptions.Multiline) col.Count = 2 <- if params are: -h 1 or -h 2 but col.Counts = 1 <- if params are: -h 3 why? reply to: [email protected]


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials