i'm trying to write a java regular expression to remove all the annotation from my code ,i have some pretty complex annotation that are nested and thus far i could only match on the inner annotations , here is an exemple of my annotations
@annotationA(property1 = "",
property2 = "",
property3 = "",
property4 = "",
property5 = "")
public class ClassA {
@annotationB(property1 = @annotationA(property5 = "anyChar",
property6 = false,
property1 = "anyChar",
property2 = "anyChar",
property3 = "anyChar",
property4 = "anyChar"),
params = { @annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")),
@annotationC(property7 = @annotationA(property5 = "anyChar"), property8 = @annotationA(property5 = "anyChar")), },
returnType = @annotationA(property5 = "anyChar"))
//some methode
}
and here is my regex (not escaped):
@\w+\([\n\w\s=\-"\@,.*:// {\+ }\.;+]+\)