Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

198 B
Raw Blame
/**
 * Escapes a string for use in a regular expression.
 * https://stackoverflow.com/a/6969486
 */
export function regexEscape(str: string) {
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}