On Wed, 24 Nov 2021 10:23:14 GMT, Hannes Wallnöfer <[email protected]> wrote:
>> I think the following regexes with named groups should yield the same >> results as yours: >> >> "^(?<payload>.*)//(?<markup>\\s*@\\s*\\w+.+?)$" >> >> "^(?<payload>[ \t]*([#!].*)?)[#!](?<markup>\\s*@\\s*\\w+.+?)$" >> >> (Note that I didn't try running them through the test, maybe I should have :) > > Above regexes do pass the test, but I just saw (too late) that Jon posted a > generic (language agnostic) solution below in the main conversation thread, > which probably makes above solution obsolete. Your regexes are good. To me, they are conceptually simpler than those proposed by Jon. Both yours and Jon's are simpler than what I initially had. ------------- PR: https://git.openjdk.java.net/jdk/pull/6397
