Regex::Common has a quoted regex which you should be able to tweak to do this. Note that you'll want to put your filehandle in slurp mode, since the C may have multi-line string literals (gcc < 3.3 allows this). Also, you'll need to handle implicit concatenation of adjacent literals.