Quote:
Originally Posted by abhijangda
I did the following
/\*(\w+\s*+\n*)+\*/
/\*[\w+\s*+\n*]+\*/
|
It is a simple matter of iterating over issues and building your solution.
Starting off, you will want to match 'any' string, not characters belonging to a set (A simple .* within comments, perhaps). Next, you'll need to handle detection of newline characters (\r as well as \n, if you may).
Then you'll need to understand that regex is greedy, since it would now be matching against multiple comments spread in a document (A /**//**/ would be matched as a single one). Once you've figured out a way to avoid THAT, you'll need to find a way to support comments that have multiple '*'s in them, a common sight for multi-line comments from IDEs/code-editors.
By now it would be a complex regex that STILL would not do it all for you (multiple ending *s in a line? boom!). But anyways, what are you gonna use it for?
Quote:
Originally Posted by abhijangda
Please write that regular expression for me!!
|
We could write it down for you, but that'd defeat the purpose of this board wouldn't it? But well, you can always search the web - your problem isn't unique.