Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDEA 13 regex checker in Scala

There is cool feature in IDEA to check your regex in Java.
When you hit Alt+Enter over your selected pattern, you get:

image link

And if you choose Check RegExp, you get something like this:

image link

But if you try same thing using Scala there is no Check RegExp option. I've tried hitting Alt+Enter for each of following lines of code:

val myRegex = """\w""".r
val myRegex2:Pattern = Pattern.compile("""\w""")
val myregex3 = new Regex("""\w""")

but no Check RegExp option showed. Any idea how to "enable" this feature to work with Scala?

like image 622
user2112471 Avatar asked Oct 02 '22 04:10

user2112471


1 Answers

Expanding the tip of @ziggystar, if you have the IntelliLang plugin installed, you can "inject" Regex syntax into a string. There is a message though stating that the injection was temporary, and the injection doesn't survive IntelliJ restart.

Injection screenshot

like image 100
Vic Avatar answered Oct 07 '22 19:10

Vic