I need to exclude any file that has name BUILD.BAZEL
or WORKSPACE.BAZEL
(case sensitive). I cannot use negative lookahead as Go regex does not support negative lookahead. I have this.
I tried without negative lookahead:
(^([^B].*$)|(B([^U].*$|$))|(BU(^I].*$|$))|(BUI([^L].*$|$))|(BUIL([^D].*$|$))|(BUILD([^.].*$|$)))|(^([^W].*$)|(W([^O].*$|$))|(WO(^R].*$|$))|(WOR([^K].*$|$))|(WORK([^S].*$|$))|(WORKS([^P].*$|$))|(WORKSP([^A].*$|$))|(WORKSPA([^C].*$|$))|(WORKSPAC([^E].*$|$))|(WORKSPACE([^.].*$|$))).*(?:.bazel)
The above excludes BUILD.BAZEL
successfully but does not exclude WORKSPACE.BAZEL
.
I break them up, they work fine.
(^([^B].*$)|(B([^U].*$|$))|(BU(^I].*$|$))|(BUI([^L].*$|$))|(BUIL([^D].*$|$))|(BUILD([^.].*$|$)));
(WOR([^K].*$|$))|(WORK([^S].*$|$))|(WORKS([^P].*$|$))|(WORKSP([^A].*$|$))|(WORKSPA([^C].*$|$))|(WORKSPAC([^E].*$|$))|(WORKSPACE([^.].*$|$)))
What am I doing wrong?
1