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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
"{0,2}(?:(?:\\\\(?:\w+)\\(?:\w+\$?)|(?:[A-Z]):)(?:\\(?:[^\\:*?"'<>|\r\n]+))+|(?:[^\\:*?"'<>|\r\n]+))\.exe"?\ (?<commandstring>(?:[^\r\n]*(?=")|[^\r\n]*))
Description
Written to test the .NET System.Environment.CommandLine string for the existance of arguments. If a match is found, the command arguments can be extracted by retrieving a MatchCollection and retriving the index "commandstring". Works with local and UNC filepaths.
Matches
""\\corp10\D$\temp1\temp2\file 3.exe" /out:library" | C:\file2.exe /a | file2.ex
Non-Matches
"\\corp10\D$\temp1\temp2\file 3.exe" | C:\file2.exe | "Temp App.exe"
Author Rating: Not yet rated. Brandon Haase
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: Great work!
Name: Nick
Date: 2/19/2009 11:49:32 PM
Comment:
Now besides the PathGetArgs() API, Theres a way to extract arguments from a command!


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