Click here to Skip to main content
15,886,963 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Error when loading application Pin
kubben30-May-07 5:22
kubben30-May-07 5:22 
GeneralRe: Error when loading application Pin
RoedRunner30-May-07 6:03
RoedRunner30-May-07 6:03 
QuestionText being cut off in a field using crystal reports Pin
steve_rm30-May-07 3:07
steve_rm30-May-07 3:07 
AnswerRe: Text being cut off in a field using crystal reports Pin
Rupesh Kumar Swami30-May-07 22:11
Rupesh Kumar Swami30-May-07 22:11 
QuestionAccess Compact and Repair Pin
CCG330-May-07 2:35
CCG330-May-07 2:35 
QuestionFolders and Files Permission and Security Pin
FriendlySoluations30-May-07 2:25
FriendlySoluations30-May-07 2:25 
QuestionResetting your Active Directory password Pin
Central_IT30-May-07 1:55
Central_IT30-May-07 1:55 
QuestionRegex Problem Pin
jimmahnow20-Feb-24 12:49
jimmahnow20-Feb-24 12:49 
Hi there everyone,
I'm trying to do what is basically a String.Replace but not quite.

I have a string e.g. "{Team}/{Team} Index" and a hashtable of replacement string values, e.g. "Wigan Athletic", "Manchester United".
I need to loop through the hashtable and replace the first occurrence of the substring "{Team}" with "Wigan Athletic", and then on the next iteration replace the substring "{Team}" with "Manchester United".

The problem I've got is (obviously) String.Replace replaces all occurrences of "{Team}" the first time through, and using regex every expression I write seems to select both occurrences.

Is there a way to stop the regex matching after hitting the first match? Or otherwise some method of doing this that I'm just missing?

Any help much appreciated Smile | :)

Thanks,
James
AnswerRe: Regex Problem Pin
andyharman30-May-07 3:36
professionalandyharman30-May-07 3:36 
GeneralRe: Regex Problem Pin
jimmahnow30-May-07 4:27
jimmahnow30-May-07 4:27 
GeneralRe: Regex Problem Pin
PIEBALDconsult20-Feb-24 12:55
mvePIEBALDconsult20-Feb-24 12:55 
GeneralRe: Regex Problem Pin
Richard MacCutchan20-Feb-24 21:48
mveRichard MacCutchan20-Feb-24 21:48 
GeneralRe: Regex Problem Pin
PIEBALDconsult21-Feb-24 3:18
mvePIEBALDconsult21-Feb-24 3:18 
Questionapi Pin
Sonia Gupta30-May-07 1:39
Sonia Gupta30-May-07 1:39 
AnswerRe: api Pin
Duncan Edwards Jones31-May-07 0:04
professionalDuncan Edwards Jones31-May-07 0:04 
QuestionRe: api Pin
Sonia Gupta30-May-07 2:02
Sonia Gupta30-May-07 2:02 
AnswerRe: api Pin
Rupesh Kumar Swami30-May-07 2:22
Rupesh Kumar Swami30-May-07 2:22 
GeneralRe: api Pin
Sonia Gupta30-May-07 2:36
Sonia Gupta30-May-07 2:36 
QuestionDetecting Internect connection in VBS Pin
Dyog30-May-07 0:32
Dyog30-May-07 0:32 
QuestionInserting image(s) into a sql db Pin
justicet@sassa.gov.za29-May-07 23:47
justicet@sassa.gov.za29-May-07 23:47 
Questionproblem with SQL connection Pin
shahid_isb8529-May-07 22:57
shahid_isb8529-May-07 22:57 
Questiontext box validation in vb.net Pin
sreenivas197729-May-07 22:53
sreenivas197729-May-07 22:53 
AnswerRe: text box validation in vb.net Pin
Christian Graus29-May-07 23:11
protectorChristian Graus29-May-07 23:11 
QuestionDataGridView checkbox column problem Pin
paukiPkk29-May-07 22:28
paukiPkk29-May-07 22:28 
AnswerRe: DataGridView checkbox column problem Pin
shally_7930-May-07 3:12
shally_7930-May-07 3:12 

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.