/** Constant <code>IDX_USER="IDX_+ USER_ID"</code> */
I have several lines of code which was generated by javadoc and show up something like the above. I would want to find all lines starting with /** Constant IDX_ and all the way to the end of the line.
How should I do this? Will be using the regex search and replace capability in Eclipse to manipulate the modifications
You can use the special character
^to indicate that your regular expression starts at the beginning of a line. For example, given your regex, you could search for:You probably also want to allow whitespace prior to the comment. The regular expression
[ \t]*will match zero or more spaces or tabs, making the following regular expression:match anything starting with
/** Constant IDX_(allowing whitespace at the beginning of the line).If you want the entire line (perhaps to capture the contents of the comment after your regex, you can use
$to indicate the end of a line, and.to match any character. Combine this with*(to indicate zero or more occurences), and you’ll end up with: