-
AuthorPosts
-
November 1, 2009 at 7:14 pm #7771
WmMitchell
ParticipantIโm not very good at regex, but Iโve managed to get some code going that more or less works, at least, most of the time. But Iโm wondering why some parts search and replace without any manual intervention, and other text isnโt and it stops and I must press a key to initiate the S&R.
Hereโs part of the code in question. All of it has the same structure, so Iโm at a loss โฆ All the extra, clunky keystrokes I had to put it to get it to work but Iโm sure there must be a more efficient means of continuous, automated S&R throughout an entire document (?):
โโโโโโโโโโโโโโโโโโโโ
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ. โ,โ. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ? โ,โ? โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ! โ,โ! โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โ: โ,โ: โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โDr. โ,โDr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMr. โ,โMr. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โMrs. โ,โMrs. โ,eeFindNext | eeReplaceAll);
document.selection.Replace(โLt. โ,โLt. โ,eeFindNext | eeReplaceAll);document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/4โณ,โยผโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ1/2โณ,โยฝโ,eeFindNext | eeReplaceAll);
document.selection.StartOfDocument(false);
shell.SendKeys(โ{CTRL DOWN}{CTRL UP}โ);
document.selection.Replace(โ3/4โณ,โยพโ,eeFindNext | eeReplaceAll);
โโโโโโโโโโโโโโโโโโโโThanks!
-
AuthorPosts
- The forum โRegular Expressionsโ is closed to new topics and replies.