Skip to content

Instantly share code, notes, and snippets.

@spicyjack
Created October 14, 2022 19:16
Show Gist options
  • Save spicyjack/3710a488c2413d7cccb88fc861ec775d to your computer and use it in GitHub Desktop.
Save spicyjack/3710a488c2413d7cccb88fc861ec775d to your computer and use it in GitHub Desktop.
Example of NSRegularExpression pattern with multiline + named captures
// https://unicode-org.github.io/icu/userguide/strings/regexp.html
let TelegramMessagePattern = #"""
(?xi)
^/(?<command>(start|help|stop))
\s*
(?<argument>.*)?$
"""#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment