How can I create a regex that look for text for followed by some text and then the text { followed with some text and then the text DAO. followed with some text and then the text }, for example:
for(Entity e : list){
e.setX(someDAO.findX(e.getId()));
}
Or :
for(Entity e : list){
if(condition){
someDAO.op(e.getId());
}
}
This one didn't work for me :
\bfor\b(?s).*?DAO\.
But this will match any DAO. after a for as well as inside it, I have to be sure that I'm inside the for loop.
How can I solve this ?