I'm using Word regular expressions in Selection.Find (wildcards ON) to parse sections of a document into excel cells. I have experience with regular expressions and it seems Word has limited functionality in that regard.
My document is laid out like an outline and I'm trying to develop a robust expression to consistently hit each section on a Find. Here's an example:
7.1-1 The rain in spain...
7.1-2 Id est quo vadis...
7.2.1-1 This little piggy...
7.2.1-2 Wee, wee, wee...
7.2.2-1 Huffed and puffed...
etc.
For Selection.Find.Text I tried: ?.?.?-?* [A-Z]
This expression did not pick up 7.1-1 and 7.1-2
I also tried: ?(.?){1,}-?* [A-Z]
This expression picks up 7.1-1 and 7.1-2 but
only pickes up 2.1-1, 2.1-2, and 2.2-1 of the others.
Any ideas?
Craig Meyers, BSNucE, PE
My document is laid out like an outline and I'm trying to develop a robust expression to consistently hit each section on a Find. Here's an example:
7.1-1 The rain in spain...
7.1-2 Id est quo vadis...
7.2.1-1 This little piggy...
7.2.1-2 Wee, wee, wee...
7.2.2-1 Huffed and puffed...
etc.
For Selection.Find.Text I tried: ?.?.?-?* [A-Z]
This expression did not pick up 7.1-1 and 7.1-2
I also tried: ?(.?){1,}-?* [A-Z]
This expression picks up 7.1-1 and 7.1-2 but
only pickes up 2.1-1, 2.1-2, and 2.2-1 of the others.
Any ideas?
Craig Meyers, BSNucE, PE