Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-05-2015, 10:17 AM
nrsmd nrsmd is offline Find and replace issue Windows 7 64bit Find and replace issue Office 2013
Novice
Find and replace issue
 
Join Date: Nov 2014
Posts: 22
nrsmd is on a distinguished road
Default Find and replace issue

I want to be able to delete hundreds of hyperlinks that I needed for my print on demand soft cover book but don't want for my e-book.

They look like:

(http://cccccc) or (http:// xxxxxxxxxxxx)

So the internal portion varies as to the number of characters.

Can I do a simple find and replace (with a delete) to cover all possibilities?



I was wondering about a wild card but have no idea how I would do that.
Reply With Quote
  #2  
Old 06-05-2015, 11:18 AM
Robert2 Robert2 is offline Find and replace issue Windows 8 Find and replace issue Office 2007
Competent Performer
 
Join Date: Jun 2013
Posts: 175
Robert2 will become famous soon enoughRobert2 will become famous soon enough
Default

Do the following Find/Replace operation with the “Use wildcards” option checked:

Find What: \(http://[!^13]*\)
Replace With: clear box

Note that the above regex pattern will not catch URLs beginning with “https”. If you have any of these in your document, use the following Find/Replace (still with wildcards ON):

Find What: \(https://[!^13]*\)
Replace With: clear box
Reply With Quote
  #3  
Old 06-05-2015, 12:22 PM
nrsmd nrsmd is offline Find and replace issue Windows 7 64bit Find and replace issue Office 2013
Novice
Find and replace issue
 
Join Date: Nov 2014
Posts: 22
nrsmd is on a distinguished road
Default

That is tremendous,,,magic,,,, and does exactly what I asked for. I added a space before the first \ so that my period at the end would tighten to the word.

I tried to analyze why it works, but it's beyond my pay grade for sure.

Thank you
Reply With Quote
  #4  
Old 06-05-2015, 03:20 PM
Robert2 Robert2 is offline Find and replace issue Windows 8 Find and replace issue Office 2007
Competent Performer
 
Join Date: Jun 2013
Posts: 175
Robert2 will become famous soon enoughRobert2 will become famous soon enough
Default

The backslash before “(“ and “)” is there to “escape” the opening and closing brackets, i.e. to make them recognized as ordinary characters. Otherwise, Word would consider that the brackets define a regex “group” for back-reference.

“http://” searches for itself as a string of characters.

“[!^13]*” matches anything that is not a paragraph end mark.

Note that “\(http://*\)” or “\(https://*\)” would have done the job more simply!
Reply With Quote
Reply

Tags
find, format, replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace issue Find what box in Find and replace limits the length of a search term Hoxton118 Word VBA 7 06-10-2014 05:05 AM
Find and replace issue Issue with Find/Replace with Notes cheech1981 Word 3 08-31-2013 11:22 PM
Find and replace issue Find and Replace Format macro issue Jack Word VBA 2 12-12-2012 09:24 PM
Find and replace issue Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM
Find & Replace Insert Issue mipacker Word 0 02-18-2009 08:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft