View Single Post
 
Old 11-14-2016, 01:26 PM
WeyldFalcon WeyldFalcon is offline Windows 10 Office 2013
Novice
 
Join Date: Nov 2016
Posts: 3
WeyldFalcon is on a distinguished road
Default Dissecting a hyperlink with Find Replace Wildcards

Hello I would like to search my doc for a site link (Alt+F9 enabled to see hyperlinks) and fix a bunch of broken links.
sample links:
HYPERLINK "https://mysite/" \l "Folder1/Folder2/Folder3/RandomArticle1.htm"
HYPERLINK "https://mysite/" \l "Folder1/Folder2/Folder3/Folder4/RandomArticle2.htm"
HYPERLINK "https://mysite/" \l "Folder5/Folder7/RandomArticle3.htm"

Desired output:
HYPERLINK "https://mysite/" \l "NewFolder/RandomArticle1.htm"
HYPERLINK "https://mysite/" \l "NewFolder/RandomArticle2.htm"
HYPERLINK "https://mysite/" \l "NewFolder/RandomArticle3.htm"

I have tried Regex style in the Wildcard Find Replace
Find What:
("https://mysite/" \\l ").*(?=/*=)*/(.*\.htm")
Replace With:
\1/NewFolder/\2
Close to what I want (works in regex) but not in word, my hunch is word does not have look ahead (?=/*=)
Long story short I want to clear out data between a point and the last forward slash in the row, how is that done in Word find replace?
Reply With Quote