I have :
Dim Text = "some text here ###MONTH-3### some text here ###MONTH-2### some text here"
Dim regex = New System.Text.RegularExpressions.Regex("###MONTH[+-][0-9]###")
For Each match In regex.Matches(Text)
// What to write here ?
// So, that ###MONTH-i### gets replaced with getmonth(i)
// Therefore, final Text will be :
// Text = "some text here" + getmonth(-3) + "some text here" + getmonth(-2) + "some text here"
Next match
I think I have explained my problem properly..
So, can you please help ?
Here is what you want, I think.
This uses the
GetMonthFromMatchdelegate to process each match and in turn call thegetmonthfunction. TheRegEx.Replacefunction will use the delegate to substitute each match.