FindReplaceOptions optionsWhile = new FindReplaceOptions();
optionsWhile.setReplacingCallback(new ReplaceHandler());
WordDoc.getRange().replace(Pattern.compile("[tag(.+?)](.+?)[/tag]"), "", optionsWhile);
in ReplaceHand…...document, here is the text logged by System.out.println(e.getMatch()...