On Mon, Feb 22, 2010 at 04:28:54PM +0100, Andreas Lubensky wrote:
> i'm having some trouble building a regular expression to filter out C
> and C++ style comments (//... /*...*/).  I constructed various regular
> 
> "((/\\*([^\\*]|(\\*+([^\\*/])))*\\*+/)|(//[^\r\n]*))"

I don't think RE are the right tool for this job. You probably want a
little state machine instead (something like 'while (token != '*/') {
skip_token() }).

Why are you trying to do this? Can you do the parsing in a "real"
scripting language instead of in CMake?

tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to