How to check your RegExps in IntelliJ IDEA 11?
November 4th, 2011 by Konstantin BulenkovIn IntelliJ IDEA 11 you can check your Regular Expressions while coding without leaving the IDE. Just invoke the ‘Check RegExp’ intention action on a regular expression and play!

Tip: You can turn any string into a regular expression by injecting RegExp language. Try the ‘Inject Language’ intention action.
Tags: Code Analysis, Nika, Regexp

November 4th, 2011 at 6:58 am
Even better would be to see how the groups of the regexp apply to the sample text.
November 4th, 2011 at 7:19 am
Is this supposed to work in 110.291?
The popup is so small that the “Sample” field is invisible.
+1 for support for groups.
November 4th, 2011 at 7:39 am
This is just awesome!!!
November 4th, 2011 at 8:08 am
@Stephen Popup autoresizes when needed.
@Joe you mean show all groups below the Sample text box?
November 4th, 2011 at 8:25 am
Great feature, also +1 for groups!
November 4th, 2011 at 8:26 am
Autoresize is not working.
I’ve open two projects and after the popup is shown the focus moves to second project and all typed letters are appeared in the second project editor.
Please, prevent input field from collapsing.
+1 for show group captures.
I prefer to see matched group strings at the right of popup component as string.
May be it is better to replace popup hint with dialog. Or move testing regex to pane (like it was in RegexPlugin http://plugins.jetbrains.net/plugin/?id=19)
November 4th, 2011 at 9:06 am
I have same issue as Stephen, no way I can resize nor access example field
I just see a small line. Probably because I changed application default font or something (I am on linux, gnome if that matters)
November 5th, 2011 at 2:37 am
+1 for RegexpPlugin - very good plugin
November 8th, 2011 at 10:31 am
Agreed, this is just super neat!
November 8th, 2011 at 10:35 am
By the way did you remove the Java regex constructs from the autocompletion popup in Jvascript regexes. http://youtrack.jetbrains.net/issue/IDEA-70998
(This behaviour might be present for other language.)
November 9th, 2011 at 2:08 pm
Nice feature. Unfortunately I am also not seeing the sample text field.
Charles opened a YouTrack for that issue:
http://youtrack.jetbrains.net/issue/IDEA-76512
November 10th, 2011 at 1:26 pm
Look very helpfull! I’ll try to implement it in vs2011 as add-in.
November 15th, 2011 at 5:40 pm
How do you trigger this to appear? Pressing alt-enter on a regex doesn’t offer an option to bring this up (using 110.365).
November 16th, 2011 at 4:00 am
Hello Mike, do you have IntelliLang plugin enabled? It’s enabled by default.
November 16th, 2011 at 4:02 am
@Mark, thanks. Fixed. Balloon was too close to top border - what’s the reason it changed its size
November 16th, 2011 at 10:25 am
I do indeed have the IntelliLan plugin enabled and the intention won’t appear. However, I should point out that the RegEx is in Groovy code. I will try it in Java code and see what happens.
December 26th, 2011 at 11:08 am
@Mike: also in groovy regexp (e.g.: /[0-9]*/) works. You have to inject “RegExp” language to the string.
April 23rd, 2012 at 9:16 pm
Yes - I too tried this in Groovy code and there are no issues.
Here’s some sample code that works:
def emailAds = “somebody@somewhere.com”
boolean regexMatch = emailAds.matches(”s[a-z]+@[a-z]+.com”)
println “Regex matches: ${regexMatch}”
* Highlight the regex above ie. s[a-z]….. (excluding the quotes)
* Hit Alt-Enter and inject the RegExp language against that regexp.
* Highlight that same regexp above (excluding the open and close
quotes)
* Right click and select Check RegExp.
* You should now see the popup against which you check your regexps.
It’s truly a beautiful thing.
Kudos a hundred times over to Dmitry and the JetBrains team. Brilliant job and extremely usable.
September 14th, 2012 at 10:55 am
I have Intellij idea 11.1.3 ultimate edition and there ain’t no Check RegExp intention among available intentions. How’s that ?
February 25th, 2013 at 3:55 am
Very nice Plugin, but it would even nicer, if one could resize the pop up window und enter multiline samples.
Als a visual feedback for group matching would be really nice.
I know, I am completely indulged by the existing eclipse reg exp plugins