Skip to content

Negate Character Classes with Exclamation Marks or Carets

Compare
Choose a tag to compare
@bmatcuk bmatcuk released this 26 Dec 16:40
· 50 commits to master since this release

To match POSIX patterns, v3 of doublestar supports negating character classes with exclamation marks (ie, [!...]) in addition to carets ([^...]). This is a minor breaking change if any of your existing patterns happen to include an exclamation mark as the first character in a character class. To fix the issue, simply escape the exclamation mark (ie, [\!...]) or move it later in the character class (ie, `[...!...]').