Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expression to find the start and end of a javadoc comment?

Status
Not open for further replies.

BFP

Technical User
May 18, 2000
52
0
0
US
Hi.

Is it possible to use a regular expression (in TextPad) to find the following?

Code:
    /**
     * Some comment
     * ...
     */
        public foo(foo);

That is, I want to start finding the "/**", then "*/", then ";"

Is this possible with a single regular expression?

Thanks in Advanced,

BFP
 
you cannot match line breaks with repetition operators in textpad, so you cannot write a regex to find a javadoc comment spanning an arbitrary number of lines. your regex would be able to match only a specific length javadoc comment, e.g. to find the comment above:

Code:
[[:space:]]*\/\*\*[[:space:]]*\n.*\n.*\n.*\*\/[[:space:]]*

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top