Skip to content

Instantly share code, notes, and snippets.

@hasancanakgunduz
Created June 25, 2022 18:37
Show Gist options
  • Save hasancanakgunduz/a9be45fac3ce8b0a92ef272fdc243a20 to your computer and use it in GitHub Desktop.
Save hasancanakgunduz/a9be45fac3ce8b0a92ef272fdc243a20 to your computer and use it in GitHub Desktop.
RegexConversion
let oldRegex = /\b[A-Za-z][A-Za-z0-9]{2,15}\b/
let newRegex = Regex {
Anchor.wordBoundary
CharacterClass(
("A"..."Z"),
("a"..."z")
)
Repeat(2...15) {
CharacterClass(
("A"..."Z"),
("a"..."z"),
("0"..."9")
)
}
Anchor.wordBoundary
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment