Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2018, 02:50 PM
jeffreybrown jeffreybrown is offline Remove repeated number after square bracket Windows Vista Remove repeated number after square bracket Office 2007
Expert
Remove repeated number after square bracket
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default Remove repeated number after square bracket

As you can see from the examples below, I would like to remove the number right after a square bracket, but only if it is a direct match to the number before the square bracket.



Before
[Philippians 3:12-13] 12 Not that I have
[Joshua 3:5] 5 Then Joshua
[Romans 7:21] 21 I find then

After
[Philippians 3:12-13] 12 Not that I have
[Joshua 3:5] Then Joshua
[Romans 7:21] I find then
Reply With Quote
  #2  
Old 12-03-2018, 03:03 PM
Guessed's Avatar
Guessed Guessed is offline Remove repeated number after square bracket Windows 10 Remove repeated number after square bracket Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

Search with wildcards
Find: ([0-9]{1,2})\] \1
Replace: \1]
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 12-03-2018, 03:07 PM
jeffreybrown jeffreybrown is offline Remove repeated number after square bracket Windows Vista Remove repeated number after square bracket Office 2007
Expert
Remove repeated number after square bracket
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

That works great Andrew. Thank you.
Reply With Quote
  #4  
Old 12-03-2018, 06:09 PM
Guessed's Avatar
Guessed Guessed is offline Remove repeated number after square bracket Windows 10 Remove repeated number after square bracket Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

Note that an example like the following would also be found with that string and you might not want that.
[Philippians 3:12-13] 13 Not that I have

You could add the colon into the mix if that was an issue.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 12-04-2018, 03:25 PM
jeffreybrown jeffreybrown is offline Remove repeated number after square bracket Windows Vista Remove repeated number after square bracket Office 2007
Expert
Remove repeated number after square bracket
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Andrew,

Yes your right, it does strip out the number.

[Philippians 3:12-13] Not that I have

I am terrible at these patterns, so if you could, how would you add in the colon?
Reply With Quote
  #6  
Old 12-04-2018, 03:57 PM
Guessed's Avatar
Guessed Guessed is offline Remove repeated number after square bracket Windows 10 Remove repeated number after square bracket Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

Find
Code:
:([0-9]{1,2})\] \1
Replace
Code:
:\1]
where the colon is included in the text in the find and replace :-)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 12-04-2018, 04:04 PM
jeffreybrown jeffreybrown is offline Remove repeated number after square bracket Windows Vista Remove repeated number after square bracket Office 2007
Expert
Remove repeated number after square bracket
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Andrew,

That's telling me 0 replacement made.
Attached Images
File Type: jpg Capture.JPG (52.4 KB, 18 views)
Reply With Quote
  #8  
Old 12-04-2018, 05:18 PM
Guessed's Avatar
Guessed Guessed is offline Remove repeated number after square bracket Windows 10 Remove repeated number after square bracket Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

It's working on my machine and it looks right on yours.

Perhaps you can reveal the spaces on your machine so you can verify that there is only one regular space after the square bracket in the document you are searching.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 12-04-2018, 06:01 PM
jeffreybrown jeffreybrown is offline Remove repeated number after square bracket Windows Vista Remove repeated number after square bracket Office 2007
Expert
Remove repeated number after square bracket
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Yes, sorry, you are right. There where extra spaces. It's all good now.

Thanks Andrew
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to remove this square thing tonythegreek Word 1 09-22-2018 02:08 PM
How remove a repeated text box from all slides in PowerPoint FlashPoint PowerPoint 10 01-08-2018 08:44 AM
Word 2010 - Remove square-bracket encased string in large document IntestinalWorm Word 1 06-20-2017 01:14 AM
Remove repeated number after square bracket Remove title from APA citation repeated first author pablrodr Word 4 09-11-2015 01:00 AM
Remove repeated number after square bracket Figure number for repeated use in paragraph rahul4msoffice Word 1 05-01-2013 11:35 PM

Other Forums: Access Forums

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