Regex for all ocurrences on Java Commented Lines (in Eclipse) -
i need replace occurrences of abc xyz, if occur in javadoc comments.
i using eclipse.
i believe requiring line starts either \s*\* or \s/\* should sufficient purposes (no need match "occurs between /** , */", work fine too).
i tried using: (\s\*|\s/\*)(.*)abc , replacing $1$2xyz problem regex greedy gives me longest line matches string (i.e., can replace last abc on given line). there way ask all possibilities, or outside of scope of (non-recursive) regular expressions?
if outside scope, recursive expression work? (which eclipse not support in case).
to knowledge not possible. regex traverses each character of input text once , can't go back.
you can either match on first abc or last abc of javadoc line, because time has matched on either of them, characters defining line javadoc comment can't matched again.
Comments
Post a Comment