I found very useful the Regular Expressions support in the "Find and Replace" window of the Eclipse IDE.
Here some expressions I used. Mainly a reminder for me, of course; but I think they can be useful for others as well, as working examples.
Note that you can refer to groups within the regular expression in the "Search" field, with the symbol $ followed by an increasing number: $1 for the first group defined in the regular expression, $2 for the second and so on...
---
From: qDebug() << "Hello" << world.name() << "t_int32" << "!";
To: ERS_DEBUG(2, "Hello" << world.name() << "t_int32" << "!");
Search: (qDebug[(][)])(\s*[<]+\s*)(.*)([;])
Replace: ERS_DEBUG(2, $3);
---
Monday, March 14, 2011
Regular expressions in Eclipse: some working examples
Pubblicato da
Pelerin-Voyageur
a
3:43 AM
0
commenti
Etichette: eclipse, programming, regular-expressions
Subscribe to:
Posts (Atom)