Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2021, 08:08 PM
Guessed's Avatar
Guessed Guessed is offline how do I replace string 123-4 with 123 4 Windows 10 how do I replace string 123-4 with 123 4 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

David
I have no idea of what you are trying to do with your numbers as you don't appear to want to change the individual pages but do want to change spans but not deal with numbers that click over a second digit. Then 113-14 needs to become 115-34?? That one makes no sense at all to me.

My code is using Word's built-in wildcard functionality. This is similar to regex but less powerful. If you want to search for a number with between 1 and 3 digits you look for "[0-9]{1,3}" so you are probably trying to find "[0-9]{1,3}-[0-9]{1,2}"
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 10-31-2021, 01:08 AM
davidjm davidjm is offline how do I replace string 123-4 with 123 4 Windows 10 how do I replace string 123-4 with 123 4 Office 2016
Novice
how do I replace string 123-4 with 123 4
 
Join Date: Jun 2018
Posts: 18
davidjm is on a distinguished road
Default

Apologies for not being clear.

I was asked to update this index and noticed inconsistencies in the format of ranges eg. 128-0 & 128-30 and was trying to find the simplest way (for me) to deal with them, obviously 2 digits numbers after the dash is best.
Really just need to increment all the page numbers by 2, hope that makes more sense.
Thanks for any help

p.s.
Just realized another misunderstanding, the previous post I sent you highlighted in red the errors that were output from the script you sent and where not meant to indicate results that I expected - sorry for the confusion.

Last edited by davidjm; 10-31-2021 at 06:13 AM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I replace string 123-4 with 123 4 Replace characters in a string Marcia Excel Programming 5 05-04-2020 05:15 AM
how do I replace string 123-4 with 123 4 Wildcard replace any string in context with a specified string wardw Word 7 05-07-2018 09:13 AM
how do I replace string 123-4 with 123 4 Replace multiple strings by one same string at once puff Word 2 02-28-2018 11:04 AM
how do I replace string 123-4 with 123 4 Replace characters in a string Anthon Excel Programming 1 11-03-2016 12:48 AM
How to do multiple find and replace in string. PRA007 Word VBA 2 01-06-2016 09:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:33 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