#### Fix crashes on formatting directory names that have special characters (#18452 by @fisker)

<!-- prettier-ignore -->
```sh
prettier . --check

# Prettier stable
[error] Invalid configuration for file "<CWD>\test\username[repo-name]\.editorconfig":
[error] Invalid regular expression: /^(?=.)username[repo-name]$/: Range out of order in character class

# Prettier main
Checking formatting...
[warn] test/username[repo-name]/test.js
[warn] Code style issues found in the above file. Run Prettier with --write to fix.
```
