Thanks Graham that looks good, I am just concerned about any variations that might happen (if any) so i will not end this thread just yet.
Main Topics
Browse All Topics
Could someone please tell me the regular expression to find an American date in a word document.
The date would look like this - 11/06/2009 but I would prefer that it allows for various dividers "/" "-" "."
I do intend to eventually put this into a VBA macro so if anyone want to comment on anything I can do for the first 12 days of the month I would appreciate it. What I mean is until 11/13/2009 the date is still a "date" eg 11/06/2009 is both 11 June 2009 and 06 November 2009. As far as I can tell there is nothing that can be done about this, the person activating the macro must first realise that it is an American date.
Thank you in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This is why a more logical standard for dates would be SO nice!
Graham's expression will find the pattern you need, but nothing can be done to determine whether the user inadvertently reversed the first two 2-digit patterns (as in your example).
What I have done in similar situations is extract all of the date-like patterns to get a sense of what approach the user was PROBABLY using, and then make my changes.
To do this, use Graham's expression in the Find box, and click the "Highlight all items found in: Main document" option. This lets you click Find All to select all found patterns. Drop out of the Find box and use Ctrl-C to copy them all to the clipboard. Open a new document and paste to get a list of all found patterns. Now you can sort this list and scan through it to see what pattern dominates: if there are a lot of >12 values in the first 2-digit location, they probably intend to use a DDMMYYYY pattern; otherwise, MMDDYYYY.
Of course, once you have the pattern determined, I hope you will use the Replace functions to set the dates to the more logical YYYYMMDD format:
Find what: ([0-9]{2})([./-]{1})([0-9]
Replace with: \5\3\1
(Replace all with the wildcard option turned on)
If the user has accidentally inverted the MM and DD values, you will not be able to fix them because you won't have any clue to know they were reversed -- except perhaps by reading the context.
Note that the odd characters displayed in the "Replace with" part of my comment are en dashes: I enter them as Alt-0150 to get a dash that is typographically preferable to a hyphen. I guess EE's display doesn't render them as I expected. (An en dash is usually the same width as a digit in typography, so columns line up more accurately; a hyphen is narrower.)
Business Accounts
Answer for Membership
by: GrahamSkanPosted on 2009-11-06 at 01:32:29ID: 25757762
Try this wildcard find string:
/-]{1}[0-9 ]{4}
[0-9]{2}[./-]{1}[0-9]{2}[.