Issue skiping characters by Regular Expressions searching Word

P

pochtara

When using Regular Expression search using VBA script in Excel to search Word
document, "-" character in the word document gets skiped (substituted with ""
empty character).

Here is the string in Word: <DE4.0><SWR4.4.l‑CE6:A>

Here is the snipet of VBA code used:

With Selector.Find
.text = "\<DE?*^13"
.Replacement.text = ""
.Forward = True
.Wrap = wdFindzz
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
While Selector.Find.Execute
s = Selector.text
Wend

The search find the string in the Word and here is the resulting string in
the VBA: <DE4.0><SWR4.4.lCE6:A>



As you can see the "-" hyphen character is missing in the resulting string
and I can't understand why and how to fix it.



Can someone help me with this?

Thanks

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top