- \s+ do not match line breaks
- A: Use \s+\n to search beyond line breaks.
- Is it possible to confine RegexReplace within a region.
- Yes. Select the region accross more than one line before popup the RegexReplace
dialog. Operations would be confined to the text selection in the editor when RegexReplace
dialog is activated. This is most handy to perform ReplaceAll action for the selected region.
Note that in case, the RegexReplace dialog is out of focus and activated again, it reset the
region to the new text selection. When no text range is selected when the dialog is activated,
it works on the whole buffer. Also, search region is reset to the whole buffer after ReplaceAll
action (this is a side effect of popping up the progress dialog).
- Is it possible to confine RegexFind to part of the Tree or Table.
- Yes for Tree, no for Table. If there is a selection in the active tree viewer
when RegexFind is invoked, RegexFind is confined to the elements in initial selection and its
children. RegexFind determine the search space when the dialog popup, going out focus and back
would not change the search space. RegexFind always search the whole Table.
- If you accidentally poping up the RegexFind dialog in a very large tree, it may
takes forever to load all the elements, hit the close button to abort and select a smaller
region to search.
- Why the search pattern typed into the RegexFind dialog reversed in Eclipse 2.1.0
- The problem is probably due to the GTK library failed to update the caret when
there are great delay in the Combo ModifyEvent handler. The delay in the ModifiyEvent hanlder
in this case is most probably due to overhead in updating selection in a large tree when
performing incremental search. It happens even if the search space is confined to a very small
selection. If you type very slowly, you can see the caret in action :( and the text would be
correct. This problem does not happen in 2.1.0 M4-Motif. Eclispe 2.0.2-Motif is still the best
bet for now.
- Why RegexFind dialog cannot popup by hot keys in 2.0.x.
- There are various reasons for this. One of which is problem with the 2.0.x key
binding. The hot-key sequence is trapped in that viewer by Eclipse. Use the menu. It works fine
in 2.1.0 and RegexReplace invoked from editor works fine with accelerator keys in both 2.0.x
- Even activated from the menu, the RegexFind dialog may fail to popup. Check the
console and the Eclipse Error Log for any exceptions and debug messages. Very often, it is due
to the fact that the View have not make the TreeViewer or TableViewer available to outsider.
RegexReplaceAction use reflection to find a getTreeViewer(), getTableViewer() or getViewer()
method to access the viewer in the view. If none of them are available, RegexFind dialog would
fail to popup.
- So far, Java Package Explorer, Nagivator, Search View, and MethodView,
AnnotationView are known to work with RegexFind. Outline pages of the Black-sun editors also
work with RegexFind but JavaOutlinePage does not (use MethodView instead).
- How to change the accelerator keys that invoke RegexFind and RegexReplace.
- In JdtPlugin plugin.xml. They share a single accelerater key seqeuence.
- How to put TAB and CR/LF in the replace field of the RegexReplaceDialog.
- Use \t, \r, and \n.
- I don't want the action to cluster the editor context menu, how can I take it
- Comment out the popup menu extension viewerContribution item in the JdtPlugin's
plugin.xml. The action should still available through accelerator and the Black-sun menu.