demo · v135
Safe glob builder
Type any user input and watch it become a safe regex pattern that escapes every metacharacter except the literal *, which is converted to .*. This is the classic "user-supplied glob" use case — secure when you wrap it in RegExp.escape (Chrome 135), and unsafe without it.
RegExp.escape: ?
resulting RegExp
matches
| string | safe pattern (with escape) | unsafe (no escape) |
|---|