Skip to content

Commit ba01806

Browse files
committed
document that a / takes priority over extglob sections
fix: #274
1 parent e5c04b4 commit ba01806

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,13 @@ differences:
510510
whole pattern as a literal string. In this library, only the
511511
`?(` is literal, and the rest of the pattern is still matched
512512
as a glob. So `a?(b*` matches `a?(bcc` here, but not in Bash.
513+
- A pattern is split into portions on every `/`, including a `/`
514+
inside an extglob. So `@(a|b/c)/*` becomes the portions
515+
`@(a|b`, `c)`, and `*`, and its extglob is not closed. Bash
516+
keeps the extglob whole, and drops each alternative with a `/`
517+
in it, as no portion can contain a `/`. So in Bash, `@(a|b/c)/*`
518+
is the same as `@(a)/*`. Leave out the alternatives with a `/`
519+
to get the same result here.
513520
- With `nocase`, case is folded one code point at a time with
514521
Unicode simple case folding, the same as a JavaScript RegExp
515522
with the `iu` flags. Bash uses the case functions of the C

0 commit comments

Comments
 (0)