FindReplaceOptions optionsWhile = new FindReplaceOptions();
optionsWhile.setReplacingCallback(new ReplaceHandler());
WordDoc.getRange().replace(Pattern.compile("[tag(.+?)](.+?)[/tag]"), "", optionsWhile);
in ReplaceHand…...Document("C:\\temp\\find replace test.docx"); ReplaceHandler handler...return afterRun; } } From the test document, here is the text logged...