Comments in string and strings in comments

Posted by Jay Gridley on Stack Overflow See other posts from Stack Overflow or by Jay Gridley
Published on 2010-04-04T20:40:41Z Indexed on 2010/04/04 20:43 UTC
Read the original article Hit count: 612

Filed under:
|

Hi there,

I am trying to count characters in comments included in C code using Python and Regex, but no success. I can erase strings first to get rid of comments in strings, but this will erase string in comments too and result will be bad ofc. Is there any chance to ask by using regex to not match strings in comments or vice versa?

© Stack Overflow or respective owner

Related posts about python

Related posts about regex