Hi, I'm writing a plugin for emacs to compile and run a java source file with one keystroke. Now I would like to find out the name of the main class or if there is none. Anyone knows how to match a java main class name with regexp?
My first thought, in pseudo code regex is
- find the first word preceded by "class " and succeeded by "{"..."public static void main(String[]"
edit- this is how far I've come. Not fully functionally yet but almost...
(?<=class ).*[^ ](?= *{.*public static void main)
I hate regex but still i like it. It's just that it's so hard to master.