You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current regular expression used to find the comments is broken. It reads:
"^/\*.*?\*|\s+/\*.*?\*/"
This matches either:
At the beginning of a line (^) start at /*, match the shortest string of any characters (.*?) followed by a star (*)
Or (|)
At least one whitespace (which may include newlines) (\s+) followed by /*, followed by the shortest string of any characters (.*?), followed by */.
Notice that the first case ends the match in *, not in */. This is what happens in your example, where the match ends with the lone * and the Community */ part is left over.
When you add an empty line before the comment string, the second case comes into action which (more correctly) matches <whitespace> '/*' <any characters> '*/'
In commit 5298672 editor Michael Klier simply describes his change as "fixed regex" and does not explain why he exchanged a simple regex, which by the way also includes a match with comments of the style
// One-line comment
with a more complicated one which only allows a comment which either starts at the beginning of a line or is preceded by whitespace. And which is broken 😦
->
Community */
so the line plus */ stays. I can fix this by inserting an empty line although its just a fix for a parser imperfection.
The text was updated successfully, but these errors were encountered: