Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: Linq Pin
riced2-Aug-09 23:18
riced2-Aug-09 23:18 
AnswerRe: Linq Pin
N a v a n e e t h2-Aug-09 20:42
N a v a n e e t h2-Aug-09 20:42 
QuestionFinding Nested ( ) pairs Pin
Adam R Harris2-Aug-09 20:07
Adam R Harris2-Aug-09 20:07 
AnswerRe: Finding Nested ( ) pairs Pin
OriginalGriff2-Aug-09 21:24
mveOriginalGriff2-Aug-09 21:24 
GeneralRe: Finding Nested ( ) pairs Pin
Adam R Harris3-Aug-09 9:05
Adam R Harris3-Aug-09 9:05 
AnswerRe: Finding Nested ( ) pairs Pin
Luc Pattyn3-Aug-09 0:27
sitebuilderLuc Pattyn3-Aug-09 0:27 
GeneralRe: Finding Nested ( ) pairs Pin
Adam R Harris3-Aug-09 9:10
Adam R Harris3-Aug-09 9:10 
GeneralRe: Finding Nested ( ) pairs Pin
Luc Pattyn3-Aug-09 9:24
sitebuilderLuc Pattyn3-Aug-09 9:24 
Hi Adam,

you're welcome.

if all you need is locating parentheses and assigning some colors, I wouldn't use any Regex, because (1) I'm not really familiar with them and (2) I find them both powerful and cryptic, yielding hard-to-read code.

So I would just search for the next string.IndexOfAny('(',')') and then check:
for a '(' increment your color index and apply
for a ')' apply color, then decrement color index,
where color index is indexing an array of colors in round-robin fashion.

Personally I don't like multiple colors for the same token, so what I usually do is choose only one color for all parentheses (or brackets or whatever comes in pairs), then use a second color for such token and the matching one when the cursor is right behind one.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

AnswerRe: Finding Nested ( ) pairs Pin
PIEBALDconsult3-Aug-09 5:58
mvePIEBALDconsult3-Aug-09 5:58 
GeneralRe: Finding Nested ( ) pairs Pin
Adam R Harris3-Aug-09 9:12
Adam R Harris3-Aug-09 9:12 
QuestionExcel and C# Pin
veon cheng2-Aug-09 20:04
veon cheng2-Aug-09 20:04 
AnswerRe: Excel and C# Pin
Christian Graus2-Aug-09 20:14
protectorChristian Graus2-Aug-09 20:14 
GeneralRe: Excel and C# Pin
Adam R Harris2-Aug-09 20:16
Adam R Harris2-Aug-09 20:16 
AnswerRe: Excel and C# Pin
Adam R Harris2-Aug-09 20:15
Adam R Harris2-Aug-09 20:15 
GeneralRe: Excel and C# Pin
Mycroft Holmes2-Aug-09 21:21
professionalMycroft Holmes2-Aug-09 21:21 
GeneralRe: Excel and C# Pin
Adam R Harris3-Aug-09 9:14
Adam R Harris3-Aug-09 9:14 
GeneralRe: Excel and C# Pin
Mycroft Holmes3-Aug-09 12:21
professionalMycroft Holmes3-Aug-09 12:21 
Questionfind object in List<> specific values without loop Pin
pascal.schwartz2-Aug-09 20:00
pascal.schwartz2-Aug-09 20:00 
AnswerRe: find object in List<> specific values without loop Pin
Christian Graus2-Aug-09 20:11
protectorChristian Graus2-Aug-09 20:11 
AnswerRe: find object in List<> specific values without loop Pin
N a v a n e e t h2-Aug-09 20:50
N a v a n e e t h2-Aug-09 20:50 
GeneralRe: find object in List<> specific values without loop Pin
pascal.schwartz3-Aug-09 0:41
pascal.schwartz3-Aug-09 0:41 
GeneralRe: find object in List<> specific values without loop [modified] Pin
Alan N3-Aug-09 3:00
Alan N3-Aug-09 3:00 
GeneralRe: find object in List<> specific values without loop Pin
N a v a n e e t h3-Aug-09 16:20
N a v a n e e t h3-Aug-09 16:20 
AnswerRe: find object in List<> specific values without loop Pin
PIEBALDconsult3-Aug-09 6:02
mvePIEBALDconsult3-Aug-09 6:02 
Questionhelp!!!!!!!!!!!!!!!!!! Pin
lollipop13122-Aug-09 19:50
lollipop13122-Aug-09 19:50 

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.