Open
Description
In most languages, the escape character is '\'. Sequences start with an escape character have special meaning, eg: '\n', '\t'.
Metacharacters are escape characters, but often match a group of characters, eg: '\s' matches any whitespace like '\t', '\n'.
So, when we are matching single comment lines in C, we need to use:
\/\/[^\n]*
,
instead of
\/\/[^\\n]*
which won't match a line break but a "\n" string.
Metadata
Metadata
Assignees
Labels
No labels