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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<quote>["]?)(?<param>(?:\k<quote>{2}|[^"]+)*)\k<quote>[ ]+
Description
this regex was developed for command line parsing. it will get you one parameter per match while checking for strings enclosed in double quotes and double quotes escaping (&quot;&quot;). --&gt;you will have to add a trailing space to your input string for this regex to get your last param too
Matches
"user name" password | sa "" | "user" "i like ""quotes&
Non-Matches
it | matches | everything
Author Rating: Not yet rated. Mr Regex
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: buggy
Name: eidylon
Date: 6/4/2010 4:16:07 PM
Comment:
fails for a very simple string: "this is a test" and my door I would expect 4 matches: ["this is a test", and, my, door] but it only returns two: ["this is a test", and my door]


Title: great regex
Name: dr pepper
Date: 9/12/2005 7:30:47 AM
Comment:
does exactly what i need


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