Click here to Skip to main content
15,917,964 members
Home / Discussions / C#
   

C#

 
GeneralRe: combo boxes and picture uploading in c# Pin
Yuvi Panda19-Apr-06 2:46
Yuvi Panda19-Apr-06 2:46 
Questionusage of GE API Pin
naveedqau18-Apr-06 20:18
naveedqau18-Apr-06 20:18 
QuestionHow we transfer a table from dbf to sql server 2000 through programming in c# with table schema Pin
Vinod Soni18-Apr-06 20:17
Vinod Soni18-Apr-06 20:17 
Questionexport the contents of a datagrid to a SQL 2000 Pin
Gavish George18-Apr-06 20:03
Gavish George18-Apr-06 20:03 
QuestionRegex.Split() produces extra null strings Pin
Vikram A Punathambekar18-Apr-06 19:58
Vikram A Punathambekar18-Apr-06 19:58 
AnswerRe: Regex.Split() produces extra null strings Pin
Guffa18-Apr-06 20:48
Guffa18-Apr-06 20:48 
GeneralRe: Regex.Split() produces extra null strings Pin
Vikram A Punathambekar18-Apr-06 21:19
Vikram A Punathambekar18-Apr-06 21:19 
GeneralRe: Regex.Split() produces extra null strings Pin
Jon Hulatt19-Apr-06 0:53
Jon Hulatt19-Apr-06 0:53 
It really doesn't look like you actually want to be splitting the string at all.

if you try this:-

Regex regex = new Regex(@"^(.*)(\([V,C]\d+\))(.*)");
Match m = regex.Match(entityName);
if (m.IsMatch)
  Console.WriteLine( m.Groups[2].Value);


Furthermore, your regular expression could be optimised a little - many of the brackets are unnecessary:-

^.*(\([VC]\d+\)).* should work also. Note the the submatch group number as used in my above code will be 1 for this pattern.

And if you move your submatch brackets a bit, like this,

^.*\(([VC]\d+)\).* then your submatch for the string "120 PP (C987) ERT" will contain "C987". I am of course making a wild assumption here that you don't want the brackets in the output.

Incidentally, I didn't test the above code or patterns, but they're good in substance even if they have minor errors in.

using System.Beer;

QuestionWriting rtf in word document Pin
_mubashir18-Apr-06 19:51
_mubashir18-Apr-06 19:51 
AnswerRe: Writing rtf in word document Pin
mav.northwind19-Apr-06 2:05
mav.northwind19-Apr-06 2:05 
AnswerRe: Writing rtf in word document Pin
Roy Heil19-Apr-06 7:49
professionalRoy Heil19-Apr-06 7:49 
QuestionIs there any easier way to open Directory for Exploring Pin
emran83418-Apr-06 16:04
emran83418-Apr-06 16:04 
AnswerRe: Is there any easier way to open Directory for Exploring Pin
LongRange.Shooter18-Apr-06 17:48
LongRange.Shooter18-Apr-06 17:48 
GeneralRe: Is there any easier way to open Directory for Exploring Pin
emran83419-Apr-06 13:15
emran83419-Apr-06 13:15 
AnswerRe: Is there any easier way to open Directory for Exploring Pin
alexey N18-Apr-06 22:57
alexey N18-Apr-06 22:57 
GeneralRe: Is there any easier way to open Directory for Exploring Pin
emran83419-Apr-06 13:13
emran83419-Apr-06 13:13 
Questionimage gets distorted after resizing Pin
deepak118-Apr-06 14:34
deepak118-Apr-06 14:34 
AnswerRe: image gets distorted after resizing Pin
Guffa18-Apr-06 21:38
Guffa18-Apr-06 21:38 
QuestionSQL SERVER EXPRESS or Professional Pin
emran83418-Apr-06 14:20
emran83418-Apr-06 14:20 
AnswerRe: SQL SERVER EXPRESS or Professional Pin
Paul Conrad18-Apr-06 17:43
professionalPaul Conrad18-Apr-06 17:43 
AnswerRe: SQL SERVER EXPRESS or Professional Pin
LongRange.Shooter18-Apr-06 17:50
LongRange.Shooter18-Apr-06 17:50 
Questionfraction.... Pin
KORCARI18-Apr-06 13:03
KORCARI18-Apr-06 13:03 
QuestionIntuit's QuickBooks SDK Pin
Michael A. Barnhart18-Apr-06 12:49
Michael A. Barnhart18-Apr-06 12:49 
QuestionSQL server dynamic connection Pin
namiiiii18-Apr-06 11:54
namiiiii18-Apr-06 11:54 
AnswerRe: SQL server dynamic connection Pin
LongRange.Shooter18-Apr-06 18:13
LongRange.Shooter18-Apr-06 18:13 

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.