I want to capture all the *
in the code except the comment section.
The regex for comment section is: (\/\*\[\S\s\]*?\*\/)
I tried excluding the the comment section and search for any *
character preceded/succeeded by 0 or more spaces.
Regex : [^\/\*[\S\s]*?\*\/\]\s*\*\s*
/**
* This function is useless
*
* @return sth
*/
public void testMe() {
int x = 5*4;
x*=7;
x = x**2;
}
It should match all the *
inside testMe
.