This may be helpful to you
Dim Regex1 As Regex = New Regex("\(\s*p[ages]*\s*(\d+)\s*of\s*(\d+)\s*p[ages]*\s*\)", RegexOptions.IgnoreCase)
Dim Match1 As Match
Match1 = Regex1.Match(MyString)
If Match1.Success Then
MyString = Regex1.Replace(MyString, String.Format("(Page {0} of {1} Page{2})", Match1.Groups(1).Value, Match1.Groups(2).Value, _
IIf(Match1.Groups(2).Value = "1", "", "s"))
End If
You may accept and vote the solution if your problem is solved, otherwise please post your queries
[edit]Replaced (\d*) with (\d+) in the Regex patterns to ensure that at least one digit shall be present for page No. to match with the pattern - PES [/edit]