I want to find a block Using Regular expression. Here Used the below reg expression for finding try block which has only "logger.error("................")" and no business logic in the block. Please see the below code sample code reference
try[\s]\{((/\(.|[\r\n])?\/)|\s)*\}
So please provide how to find logger.error
in the try block with explain.
Ex:
try {
System.out.println("......");
/*
* fsdsddgd ddgdgdfg gdfgdgdfg gdfgdfg fgdfgfg
*/
/*
* fsdsddgd ddgdgdfg gdfgdgdfg gdfgdfg fgdfgfg
*/
//single line comments
logger.error("................");
}
Thanks in advance