stam wrote: ↑Thu Apr 08, 2021 4:31 pm
This works really well and picks out all comments;
but it also picks up any text within quotation marks, was this the intent?
Hi Stam,
Yes, that's how it works without using my sunnYrex library.
This can be avoided, but only if you can manage back references
in the replacement text
The reason behind is I need to parse strings to avoid false positives;
e.g
" xxxxx -- # // not a comment "
In my demo, I use this to colorize the strings and the comments with 2 different colors;
thus the proof that we know if it is a comment or a string.
It's possible to filter the resulting array for comments only.
I see if I get some time free to make a variant of this code
to achieve what you would like to have.
And finally, this was an interesting exercice
and at the same time a response to kelly's OP
Be well,
Thierry