Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2019, 01:49 PM
macropod's Avatar
macropod macropod is offline Regex over 700 matches in a long doc Windows 7 64bit Regex over 700 matches in a long doc Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You're unlikely to need regex for this. That said, without a sample document showing the kind of content you're trying to process, we'd only be guessing.

Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 03-03-2019, 02:49 PM
totoMSOF totoMSOF is offline Regex over 700 matches in a long doc Windows 7 64bit Regex over 700 matches in a long doc Office 2010
Novice
Regex over 700 matches in a long doc
 
Join Date: Mar 2019
Posts: 11
totoMSOF is on a distinguished road
Default

The pattern regex is as follows:
.Pattern = " \(\[[A-Z][A-Z0-9-&*]*\](,[^\)]+|)\)"

Here are two files for example (don't look at the text, I took it from Internet to have an english doc...):
1) input_example.doc, with a list of references in the text, the form of which is of the pattern above (e.g. " ([ABC], p. 145)");
2) output_example.doc, wich is the same doc with references in footnotes.

I get the output example using my code, but for that I had to remove the sumary, and to ensure there were not too many references. Otherwise, I'd get the behavior described in the first post...

Well, even if this work doesn't require regex, I'm afraid I'm going to meet the same kind of problem concerning exact positioning of footnotes. So any kind of help appreciated .

EDIT: 1) Moreover, I'd like to understand what's wrong in my code, in case of...
2) Correction in regex (replace * by + and switch ) with \) at the end).
Attached Files
File Type: doc input_example.doc (52.5 KB, 11 views)
File Type: doc output_example.doc (54.0 KB, 11 views)
Reply With Quote
Reply

Tags
regex, replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex over 700 matches in a long doc Using VB Regex feature, I tried to replace 'the' and 'this' with 'that' but got screwed abdan Word VBA 3 01-18-2019 09:38 PM
How to compare 2 Excel sheets for 100+ matches? dylansmith Excel 5 05-22-2017 09:09 PM
Macro help regex subspace3 Word VBA 1 10-15-2014 09:53 AM
Regex over 700 matches in a long doc Convert RegEx to Word (Devanagari Font Find/Replace) gasyoun Word VBA 9 04-12-2013 04:15 PM
Regex in Word: Replaced strings are in disorder chgeiselmann Word 0 04-26-2009 11:33 AM

Other Forums: Access Forums

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