Let's say I have a HUGE file. This huge file contains a bunch of code. In this code every function is documented in XML format. Each documentation is enclosed in 'documentation comments' (/** and **/). I want a regular expression that will remove all code that is not between documentation comments (that would also include the documentation comments but I can remove them afterwards if needed).
Example of part of the script:
/**--------------------------------------------------------------------------**\
<summary>FunctionName</summary>
<returns>
Returns 1 on success.
Returns 0 on failure.
</returns>
<remarks>
This function is a function.
</remarks>
\**--------------------------------------------------------------------------**/
int FunctionName()
{
int X = 1;
if(X == 1)
return 1;
return 0;
}
Expected output:
<summary>FunctionName</summary>
<returns>
Returns 1 on success.
Returns 0 on failure.
</returns>
<remarks>
This function is a function.
</remarks>