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:
^\/\*\* Constant IDX_
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:
^[\t ]*\/\*\* Constant IDX_
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:
^[\t ]*\/\*\* Constant IDX_.*$