IntelliJ Community . RegexPlugin

 
RegexPlugin 

HOME INDEX SEARCH CHANGES GO  

RegexPlugin

Purpose

Regular Expression Explorer for IntelliJ IDEA.

Allows you to experiment with Java regular expressions in a dynamic environment.

Description

You can "debug" your regular expressions and check each match and group of the expression. its similar to http://brosinski.com/stephan/archives/000028.php (but not so sofisticated).

Using

After installing the plugin a new toolwindow is available at the bottom of intellij. just enter a expression pattern and a text to search for that expression and press the button or return. use the hyperlinks to get the details of the match.

Make sure you have at least idea build 922 installed.

Coping regular expressions between Java code and the plugin.

There are a pair of buttons on the plugin that require some explanation.

Clipboard -> Regex

If you select all of a Java String declaration and copy it, then click on this button. We parse the string for the regular expression automatically handling all of the escape characters and then paste the corrected expression into the Pattern window.

Regex -> Clipboard

This will copy the regular expression from the pattern window and create a valid Java String on the clipboard so that you can paste it back into your source code. Note that this function varies according to whether the Comments flag is set or not.

Between these two buttons you shouldn't have to worry about manually editing the expression to correctly escape all of the \ characters in the expression.

Example

Take the following expression (which strips out the contents of Java Strings):

  final Pattern javaStringPatternPreserveWS = Pattern.compile(
      "(?:                                                  \n" +
      " # First look for a non-escaped quote character      \n" +
      " (?:(?<!\\\\)\")                                     \n" +
      "  # Then look for the string contents                \n" +
      "  (.*?)                                              \n" +
      "  # Finish with a closing non-escaped quote          \n" +
      " (?:(?<!\\\\)\")                                     \n" +
      " # The allow this sequence to be repeated with plus  \n" +
      " # signs joining the strings                         \n" +
      " (?:\\s*\\+\\s*)*                                    \n" +
      ")                                                    \n", Pattern.COMMENTS |Pattern.MULTILINE );

If you copy all of this and then click on the Clipboard -> Regex button then we extract the multi-line regular expression and paste it into the Pattern window. If you manually paste it into the Text window and then click on the Comments check box, you see that much of the text is underlined in the results window. If you click on a particular result then you can see the details of the specific match in the details window.

e.g.

RegexPlugin.gif

Current Features

  • regex of jdk1.4
  • shows matches and groups of each match (if available)
  • thanks to Guy Gascoigne-Piggford now there are multiline texts and patterns
  • Guy again has improved the plugin (paren matching and syntax highlighting in the regex entryfield, quick reference page)
  • Matcher.replaceAll and replaceFirst supported

Plugin Development

Please see the topic RegexPluginDev, any feedback is welcome smile

Plugins installation

  • 0.1
  • just put the jar (see below) into your IntelliJ/plugins dir
  • restart IntelliJ
  • 0.2, 0.3, 0.5
  • extract the zip into the idea plugins dir
  • restart Aurora

Plugin Info

Plugin Author: GuyPiggford, ChristianKoestlin
Plugin Version: 2004-02-04 (V0.5.4)
Change History:  
04 Feb 2004 (V0.5.4): Fix for bug in library export
02 Feb 2004 (V0.5.1): Fix a npe when opening a new project
02 Feb 2004 (V0.5.0): Add library support, add standalone support
14 Dec 2003 (V0.3.3): new features by guy, works with Aurora 992, paren matching, syntax highlighting, quick reference
20 Oct 2003 (V0.3.1): Minor change to support Idea 957, should still work with earlier versions though.
11 Oct 2003 (V0.3): replaceFirst and replaceAll of Regexes supported, different packaging
7 Oct 2003 (V0.2): multiline text and pattern and regexflags (thanks to Guy Gascoigne-Piggford)
18 Sep 2003 (V0.1.1): simple exeptionhandling for illegal regular expressions, gui elements reordered
12 Sep 2003 (V0.1): Initial version
Jar Dependencies: none
| Plugin Home: | http://www.intellij.org/twiki/bin/view/Main/RegexPlugin | Feedback: | http://www.intellij.org/twiki/bin/view/Main/RegexPluginDev

Related Topics: PluginDocumentation, ProjectPluginTemplate, OpenAPI, IntellijPluginDocumentation, IntellijPluginDocumentation, PluginDeployment, IdeasForPlugins

IntelliJPluginWebForm
IntelliJPluginName: RegexPlugin
IntelliJPluginVersion: 0.5.4
IntelliJPluginVendor: GuyPiggford, ChristianKoestlin
IntelliJPluginBinary:
IntelliJPluginSource:
IntelliJPluginClassification: CodeHelper?
TopicClassification: IntelliJPluginPackage
TopicShortDescription: Allows you to experiment with Java regular expressions in a dynamic environment.
TestedOnOS: OsWin2K, OsWinXP
ShouldRunOnOS: AnyOS

Attachment: sort Action: Size: Date: Who: Comment:
regexPlugin-0.1.jar action 16829 12 Sep 2003 - 17:51 ChristianKoestlin initial version
RegexPlugin0.1.png action 3903 12 Sep 2003 - 18:13 ChristianKoestlin  
regexPlugin-0.1.1.jar action 17029 18 Sep 2003 - 22:28 ChristianKoestlin  
regexPlugin-0.2.zip action 43606 07 Oct 2003 - 20:38 ChristianKoestlin multiline texts and patterns
regexPlugin-0.3.zip action 43587 11 Oct 2003 - 18:44 ChristianKoestlin Regex.replaceFirst and replaceAll supported
regexPlugin-0.3.1.zip action 43275 20 Oct 2003 - 22:32 GuyPiggford Fix for Idea 957
regexPlugin-0.5.1.zip action 74604 02 Feb 2004 - 22:36 GuyPiggford Add Library and stand alone support
RegexPlugin-0.5.4.zip action 77343 04 Feb 2004 - 23:58 GuyPiggford Fix library export and import

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.