Post Reply 
[Req] Match 1 or more directory path levels
May. 02, 2015, 05:58 PM
Post: #6
RE: [Req] Match 1 or more directory path levels
Might as well muddy the waters...

In essence, using the Find/Replace function (Ctrl-H) will work for every iteration it finds, no matter where they occur in a string. IOW, you can nest as many iterations as you wish/need in a single sentence, and Word will find (and replace) each of them, no problem.

Now, if you try to parse a string with a unique word at the front of the "Find...", then you have a problem, and that's where JJoe's solution comes in. However...

I'm not so sure that you can use a regex in the Find/Replace box. But a "more elegant" solution might be to institute a macro, wherein one can have both recursion and a regex. I've found a link (below), and I tried it - it works just like it says on the tin. (The qualifier being that I'm on Word 2010 - I haven't re-loaded any of my previous versions to test them... sorry.)

For the full explanation and some examples, go here: http://stackoverflow.com/questions/26618...word-macro

Coupled with a final step (within the same macro) that sets the unique domain name correctly, I'd think this should do the trick. Wink But of course, the credit for the idea here has to go to JJoe, all I've done is point the way to making this as nearly a one-step solution as I can imagine.


BTW, I confess that I'm curious - why do you need to modify URL strings in Word?


HTH






Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to Oddysey for this post:
wammie
Post Reply 


Messages In This Thread
RE: [Req] Match 1 or more directory path levels - Oddysey - May. 02, 2015 05:58 PM

Forum Jump: