Click here to Skip to main content
12,624,887 members (39,083 online)

Regular Expressions

 
GeneralRe: part of string before a match Pin
TheGermoz29-Oct-12 12:08
memberTheGermoz29-Oct-12 12:08 
AnswerRe: part of string before a match Pin
Matt T Heffron29-Oct-12 12:22
memberMatt T Heffron29-Oct-12 12:22 
QuestionRegex getting special caracter Pin
TheGermoz28-Oct-12 5:46
memberTheGermoz28-Oct-12 5:46 
AnswerRe: Regex getting special caracter Pin
Richard Deeming29-Oct-12 3:24
memberRichard Deeming29-Oct-12 3:24 
You're nearly there:
string k = Regex.Match(s1, @"\(""(\w+)""\)").Groups[1].Value;

For #1, unless you need to ensure that the brackets are balanced, Regex is overkill. Add using System.Linq; to your file, and try:
int count = s1.Count(c => c == '(');



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Regex getting special caracter Pin
TheGermoz29-Oct-12 10:47
memberTheGermoz29-Oct-12 10:47 
QuestionExtract tag within pre tag Pin
Heike22-Oct-12 1:00
memberHeike22-Oct-12 1:00 
AnswerRe: Extract tag within pre tag Pin
Pete O'Hanlon2-Oct-12 1:16
protectorPete O'Hanlon2-Oct-12 1:16 
GeneralRe: Extract tag within pre tag Pin
Heike22-Oct-12 1:53
memberHeike22-Oct-12 1:53 
AnswerRe: Extract tag within pre tag Pin
BobJanova2-Oct-12 2:19
memberBobJanova2-Oct-12 2:19 
GeneralRe: Extract tag within pre tag Pin
Heike22-Oct-12 2:23
memberHeike22-Oct-12 2:23 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 26 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid