TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sampath meka
NA
41
12.3k
Regular Expressions
Feb 18 2014 1:15 AM
Hello All,
I am new to C# kindly help me with the Expected output:
What i have Done...
string strCombination = "((B48B20, XB1141) + PLUGIN_HYBRID + ECE), (B57D30 + TL + ECE), (B58B30 + ML + KEIN_HYBRID + ECE), (B57D30 + SL + US)";
string strCombination_Pattern = @"\((.*?)\)";
Regex rgx1 = new Regex(strCombination_Pattern, RegexOptions.IgnoreCase);
MatchCollection matches1 = rgx1.Matches(strCombination);
if (matches1.Count > 0)
{
foreach (Match match in matches1)
{
Console.WriteLine(match.Value);
}
}
Output:
match.Value = (B48B20, XB1141) ,(B57D30 + TL + ECE),(B58B30 + ML + KEIN_HYBRID + ECE),(B57D30 + SL + US)
Expected output:
(B48B20, XB1141)+ PLUGIN_HYBRID + ECE ,(B57D30 + TL + ECE),(B58B30 + ML + KEIN_HYBRID + ECE),(B57D30 + SL + US)
Thank u
Sampath
Reply
Answers (
13
)
How to Download a file (pdf or ppt) asynchronously in C#
linq in c# ? query