My thread is just a small friendly remark that in some cases these assignments are very useful.
Here is a regex to remove C-style comments.
Code: Select all
regex = (["'][^"']?\/\*.*?\*\/[^"']*["'])|\/\*(?:.|\R)*?\*\/
Escaping the quotation marks is error-prone for one people, boring for other, but the most important thing is that a regex with unescaped quotation marks can be tested online, for example, at https://regexr.com/. And such testing is a "must have" feature for complex regular expressions.
What I'm talking about here is may be already obvious for some people, but I personally discovered the usefulness of traditional assignments just recently.