PDA

Click to See Complete Forum and Search --> : Regexp


neptun_
Sep 20th, 2006, 04:21 AM
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

ComputerJy
Sep 20th, 2006, 10:39 AM
1- String.Substring(String,String.IndexOf("/*"),String.IndexOf("*/"));
2- String.Substring(String,String.IndexOf("//"),String.IndexOf("\n"));

penagate
Sep 20th, 2006, 10:56 AM
Can you tell me please how can I find what's :
- between /* ... */ (in multiples lines)
- after //... (in the same line)

Try:
#/\*(.*)\*/#s
^//(.*)$

mendhak
Sep 20th, 2006, 11:08 AM
If you want to capture the comments:

\/\*(?<longcomment>(.|\s)+)\*/
\/\/(?<shortcomment>(.*))