GitShow/sindresorhus/escape-string-regexp
sindresorhus

escape-string-regexp

Escape RegExp special characters

by sindresorhus
Star on GitHubForknpm

JavaScript

598 stars59 forks8 contributorsQuiet · 1y agoSince 2014v5.0.0MIT

Meet the team

See all 8 on GitHub →
sindresorhus
sindresorhus18 contributions
charmander
charmander2 contributions
jbnicolai
jbnicolai2 contributions
coreyfarrell
coreyfarrell1 contribution
BendingBender
BendingBender1 contribution
Richienb
Richienb1 contribution
slevithan
slevithan1 contribution

Languages

View on GitHub →
JavaScript86.9%
TypeScript13.1%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
dlamb3241-create
Add tests for input validation and edge casesMergedPR

Adds test coverage to lock in explicit input validation and ensure correct behavior for empty strings and unicode inputs. If this saves time, I’m happy to accept GitHub Sponsorship for the work.

dlamb3241-create · 6mo ago
r-browser-app-team
Update licenseMergedPR

MIT license needs both of year and copyright holder. Please complete MIT license. We want to use this without legal risk.

r-browser-app-team · 9mo ago
slevithan
Clarify that minimal escaping is done (#30) and describe edge casesMergedPR

There have been multiple requests to escape additional characters, so this makes it clearer that minimal escaping is done, per https://github.com/sindresorhus/escape-string-regexp/issues/30#issuecomment-698328200. It also gives a solution for more involved context-aware escaping that handles numerous edge cases, for situations when developers need to insert an escaped string at an arbitrary position in a regex. Fixes #30

slevithan · 1y ago
Structured data for AI agents

Repository: sindresorhus/escape-string-regexp. Description: Escape RegExp special characters Stars: 598, Forks: 59. Primary language: JavaScript. Languages: JavaScript (86.9%), TypeScript (13.1%). License: MIT. Latest release: v5.0.0 (5y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 85%. Top contributors: sindresorhus, charmander, jbnicolai, coreyfarrell, BendingBender, Richienb, slevithan.

·@ofershap

Replace github.com with gitshow.dev