Skip to content

Instantly share code, notes, and snippets.

/try.rb Secret

Created April 24, 2016 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/23f277beea40792716f2366f592c6298 to your computer and use it in GitHub Desktop.
Save anonymous/23f277beea40792716f2366f592c6298 to your computer and use it in GitHub Desktop.
Ruby
/^:((?<nick>\S+)!(?<user>\S+)@)?(?<server>\S+)\s(?<cmd>\S+)\s((?<target>\S+)\s)?((:(?<payload>.+))|(?<params>.*))$/
I'm trying to parse this string:
:opentux!~opentux@176.141.117.16 PRIVMSG #bottest :abc
But the payload value & params are always empty...
What's wrong with my regex ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment