Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
AnswerRe: threading in a Custom Collection Pin
Nicholas Butler12-Aug-09 1:54
sitebuilderNicholas Butler12-Aug-09 1:54 
QuestionCustom Installation Pin
lune1211-Aug-09 21:05
lune1211-Aug-09 21:05 
Questionupdate:Edit datagridview Pin
abdolrab11-Aug-09 21:00
abdolrab11-Aug-09 21:00 
QuestionNetworkStream, possibly Read timeout? Pin
Trapper-Hell11-Aug-09 20:46
Trapper-Hell11-Aug-09 20:46 
GeneralDataSet DataTime Binding Issue Pin
VenkataRamana.Gali11-Aug-09 20:18
VenkataRamana.Gali11-Aug-09 20:18 
GeneralRe: DataSet DataTime Issue Pin
PIEBALDconsult11-Aug-09 20:23
mvePIEBALDconsult11-Aug-09 20:23 
GeneralRe: DataSet DataTime Issue Pin
VenkataRamana.Gali11-Aug-09 20:32
VenkataRamana.Gali11-Aug-09 20:32 
QuestionRegular Expression problem [possibly solved] [modified] Pin
PIEBALDconsult11-Aug-09 19:01
mvePIEBALDconsult11-Aug-09 19:01 
I thought I had my Regular Expression working just fine, but then I found a weakness...

First off, I'm trying to parse a command line, so a Regex may not be the best tool, but it's so close! (And it's fine for testing purposes anyway.)

Given a command line like:

command param1 /options=( option1 , "option 2" , option3 ) "param 2"

I have no trouble getting most of this. Generally the worst part is that I have to get the contents of the options all together,
e.g. " option1 , "option 2" , option3 ", but that's not a big deal, I can parse it separately.

What I'm stumped by now, is if an option is in quotes and contains a right-parenthesis:

/options=( "(trouble)" )

The related piece of the Regex I'm using is:

"(?:/\\s*(?'Switch'\\w+)(?:\\s*=\\s*(?:(?:\"(?'Value'[^\"]*)\")|(?:\\((?'Value'[^\\)]*)\\)))|(?'Value'\\w+))?)"

I want "(trouble)", I get "(trouble


Is there a way to get the Regex to recognize that the right-parenthesis is in quotes? I assume I need a balancing-group, but I can't wrap my head around it.

Edit:
I replaced ((?'Value'[^\\)]*) with (?'Value'(?:(?:\"[^\"]*\")|[^\\)]*?)*) and it seems to work.

modified on Wednesday, August 12, 2009 1:51 AM

QuestionHow to display a chart in PDF using C#? Pin
ravi.vellanky11-Aug-09 19:00
ravi.vellanky11-Aug-09 19:00 
AnswerRe: How to display a chart in PDF using C#? Pin
stancrm11-Aug-09 21:36
stancrm11-Aug-09 21:36 
QuestionMenu items to tab pages in tabcontrol Pin
elci11-Aug-09 18:46
elci11-Aug-09 18:46 
Questionfactory method Pin
jpk42011-Aug-09 18:25
jpk42011-Aug-09 18:25 
AnswerRe: factory method Pin
PIEBALDconsult11-Aug-09 20:19
mvePIEBALDconsult11-Aug-09 20:19 
GeneralRe: factory method Pin
jpk42011-Aug-09 21:35
jpk42011-Aug-09 21:35 
GeneralRe: factory method Pin
PIEBALDconsult12-Aug-09 4:14
mvePIEBALDconsult12-Aug-09 4:14 
Question[SOLVED]convert to base 64 issue with AES encryption [modified] Pin
Member 360949111-Aug-09 16:34
Member 360949111-Aug-09 16:34 
AnswerRe: convert to base 64 issue with AES encryption Pin
Luc Pattyn11-Aug-09 16:39
sitebuilderLuc Pattyn11-Aug-09 16:39 
GeneralRe: convert to base 64 issue with AES encryption Pin
Member 360949111-Aug-09 17:06
Member 360949111-Aug-09 17:06 
AnswerRe: convert to base 64 issue with AES encryption Pin
Member 360949111-Aug-09 17:22
Member 360949111-Aug-09 17:22 
Question[Message Deleted] Pin
neha_rai11-Aug-09 10:56
neha_rai11-Aug-09 10:56 
AnswerRe: how to clear Pin
Henry Minute11-Aug-09 11:34
Henry Minute11-Aug-09 11:34 
AnswerRe: [Message Deleted] Pin
padmanabhan N11-Aug-09 18:30
padmanabhan N11-Aug-09 18:30 
Questionwhat is the best way for open connection to database ? - discussion Pin
E_Gold11-Aug-09 9:45
E_Gold11-Aug-09 9:45 
AnswerRe: what is the best way for open connection to database ? - discussion Pin
0x3c011-Aug-09 9:49
0x3c011-Aug-09 9:49 
AnswerRe: what is the best way for open connection to database ? - discussion Pin
Henry Minute11-Aug-09 10:39
Henry Minute11-Aug-09 10:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.