jeudi 1 septembre 2016

How to search for new style C++11 for loops in an existing codebase

I'm using the RegexBuddy utility, with the regex

     ^\s*for\s.*:(?!:).*$

Which I would paraphrase as 'search lines with optional leading white-space, the text 'for', a single white space, then the rest of the line containing a colon, but not two colons together'.

Which mostly works, but the two colon exclusion doesn't (they are typically iterator references).

What's the correct regex for this search? Thanks!

Aucun commentaire:

Enregistrer un commentaire