4 ms·
Perl makes it easy to do as well. # Delete (most) C comments. $program =~ s { /\* # Match the opening delimiter. .*? # Match a minimal
by sigzero 4y ago
Perl makes it easy to do as well.
# Delete (most) C comments.
$program =~ s {
/\* # Match the opening delimiter.
.*? # Match a minimal number of characters.
\*/ # Match the closing delimiter.
} []gsx;
And I always do that to remind myself what I am doing it for.
- HybridCurve 4y agoYes, perl regex options are great for commenting and overall it's one of best things about the language. I also will paste one or more commented example lines of above my regexes so it is clear what kind of input you are expected to be processing, it always ends up being a time saver when debugging or updating code.
- deafpolygon 4y agoI learned regex on perl, and the community (at the time) was always so good about commenting their regex strings in a similar fashion.