Hmm...

after checking it carefully i think my problem might not be in the regular expression. Probably I should explain it more clearly.

I'm trying to reformat a document which has many footnotes. And in the uneditted document, the footnotes are just normal number at the end of a sentence and without any space. For example this paragraph:

Chief among the modelers and, likewise, a great favorite of Napoleon, was the Marquis de Laplace, Senator of France and prince of the world?s physiciens geometres. Napoleon showered blessings on Laplace and once, on the theory that mathematicians with money can do everything, appointed him Minister of the Interior. Laplace lasted six weeks. Later Napoleon explained why: ?Laplace did not look at any question from the proper point of view; he looked for subtleties everywhere, had only problematic ideas, and carried into administration the spirit of the infinitely small.?2 Having set down the burdens of office, Laplace could devote himself entirely to standard modeling, or, as he put it, to making physics as perfect as astronomy by importing into it the mathematics and the method of the theory of gravitation.3

The program should recognize footnote number 2 and 3, and reformat it into:
infinitely small ( 2 )." and gravitation ( 3 ).

The code that i have so far looks like this (including the changes in Regex recommended by Matthew):

[vba]
Sub FindFootnote()
Dim regEx, Match, Matches

Set myRange = Selection.Range
myRange.WholeStory ' the documents main story range
Dim aSent As Object ' a sentence
Dim aPara As Paragraph ' a paragraph
Dim formattedFootnote As String

Selection.GoTo wdGoToLine, wdGoToFirst

For Each aPara In myRange.Paragraphs

For Each aSent In aPara.Range.Sentences
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = "([/?!.,""]+)(\d+)([\s\b\w*\b]?)" ' Set pattern.
regEx.IgnoreCase = False ' Set case insensitivity.
regEx.Global = True ' Set global applicability.

Set Matches = regEx.Execute(aSent.Text) ' Execute search.
For Each Match In Matches ' Iterate Matches collection.
Footnote = MsgBox("Is " & Match.Value & " in " & Chr(34) & aSent & Chr(34) & " a footnote?", vbYesNoCancel + vbQuestion, "Footnote")

If Footnote = 2 Then
Exit Sub
ElseIf Footnote = 6 Then
formattedFootnote = regEx.Replace(Match.Value, " ( $2 )$1 $3")
DoRegularReplaceOne what:=Match.Value, repl:=formattedFootnote, textBold:=False
End If
Next
Next
Next
End Sub[/vba]
Using my code it finds the footnote # 3 but not # 2.
I think the problem is because I'm reading sentence by sentence, and I'm still not sure how I should change it. If you can give me any suggestion I'd really appreciate it.

Thanks