Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2015, 07:54 AM
tinfanide tinfanide is offline Regular Expressions / Wildcards: [1990] --> (1990) Windows 7 64bit Regular Expressions / Wildcards: [1990] --> (1990) Office 2010 32bit
Expert
Regular Expressions / Wildcards: [1990] --> (1990)
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Regular Expressions / Wildcards: [1990] --> (1990)

Supposed there are a few lines on a Word document.

Code:
[1990]File[US]
[1991]File[UK]
[1992]File[JP]
In Search & Replace, I typed:


Code:
Find:
\[[0-9]{4}\]
Replace:
???
I wonder what to input in Replace if I want to change [1990] to (1990), [1991] to (1991) and [1992] to (1992).

Any help is appreciated.
Reply With Quote
  #2  
Old 08-10-2015, 10:29 AM
Robert2 Robert2 is offline Regular Expressions / Wildcards: [1990] --> (1990) Windows 8 Regular Expressions / Wildcards: [1990] --> (1990) Office 2007
Competent Performer
 
Join Date: Jun 2013
Posts: 174
Robert2 will become famous soon enoughRobert2 will become famous soon enough
Default

Try the following wildcard Find/Replace:
Find What: \[([0-9]{4})\]
Replace With: (\1)
Reply With Quote
  #3  
Old 08-10-2015, 02:34 PM
tinfanide tinfanide is offline Regular Expressions / Wildcards: [1990] --> (1990) Windows 7 64bit Regular Expressions / Wildcards: [1990] --> (1990) Office 2010 32bit
Expert
Regular Expressions / Wildcards: [1990] --> (1990)
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

#Robert2
It works like a charm.
Till today I have realised what (), \1 or \2 means. Many thanks!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expressions / Wildcards: [1990] --> (1990) regular expressions in footnotes loes Word 3 09-04-2019 07:52 AM
Regular Expressions / Wildcards: [1990] --> (1990) Regular expressions for text with complex formatting Kreol2013 Word VBA 1 04-12-2013 07:33 PM
Regular Expressions / Wildcards: [1990] --> (1990) Regular Expressions: match words within quotes? tinfanide Word VBA 3 02-02-2013 10:07 PM
regular expressions for empty lines eNGiNe Word 1 01-21-2013 06:38 AM
Regular Expressions / Wildcards: [1990] --> (1990) Regular Expressions: [!0-9] does not work??? tinfanide Excel Programming 4 05-30-2012 04:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:24 AM.


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