Hi,
I am trying to find all my comments in the project by using regular expressions.
Can you tell me please how can I find what's :
- between /* ... */ (in multiples lines)
- after //... (in the same line)
Thanks
Printable View
Hi,
I am trying to find all my comments in the project by using regular expressions.
Can you tell me please how can I find what's :
- between /* ... */ (in multiples lines)
- after //... (in the same line)
Thanks
1-2-Code:String.Substring(String,String.IndexOf("/*"),String.IndexOf("*/"));
Code:String.Substring(String,String.IndexOf("//"),String.IndexOf("\n"));
Try:Quote:
Can you tell me please how can I find what's :
- between /* ... */ (in multiples lines)
- after //... (in the same line)
- #/\*(.*)\*/#s
- ^//(.*)$
If you want to capture the comments:
\/\*(?<longcomment>(.|\s)+)\*/
\/\/(?<shortcomment>(.*))