|
-
Sep 20th, 2006, 04:21 AM
#1
Thread Starter
Member
Regexp
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
-
Sep 20th, 2006, 10:39 AM
#2
Re: Regexp
1-
Code:
String.Substring(String,String.IndexOf("/*"),String.IndexOf("*/"));
2-
Code:
String.Substring(String,String.IndexOf("//"),String.IndexOf("\n"));
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 20th, 2006, 10:56 AM
#3
Re: Regexp
Can you tell me please how can I find what's :
- between /* ... */ (in multiples lines)
- after //... (in the same line)
Try:
- #/\*(.*)\*/#s
- ^//(.*)$
-
Sep 20th, 2006, 11:08 AM
#4
Re: Regexp
If you want to capture the comments:
\/\*(?<longcomment>(.|\s)+)\*/
\/\/(?<shortcomment>(.*))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|