View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
CodeSponge[_2_] CodeSponge[_2_] is offline
external usenet poster
 
Posts: 15
Default RegEx Replacement patterns

hehe I kinda feel like I'm talking to myself.
My reath must stink :-o
Anyway, for those of you who are interested I found the answer.
For some reason when you are referring to a submatch in the replacment
pattern for a VB regular expression instead of using the \1 format you
have to use the $1 format.
personaly I think this is dumb but who am I to judge ;)

so if my search pattern is:
"(\s)ks ?#?(\d*)(\s)"

then my replacement pattern should be:
"$1KS $2$3"