Skip to content

Instantly share code, notes, and snippets.

@bascht
Created February 2, 2015 16:24
Show Gist options
  • Select an option

  • Save bascht/15ed945db4bcce7e61f1 to your computer and use it in GitHub Desktop.

Select an option

Save bascht/15ed945db4bcce7e61f1 to your computer and use it in GitHub Desktop.
irb(main):002:0> expression = /(?:OUT[=]*)/
=> /(?:OUT[=]*)/
irb(main):003:0> "OUT".match(expression)
=> #<MatchData "OUT">
irb(main):004:0> "OUT=".match(expression)
=> #<MatchData "OUT=">
irb(main):005:0> "Quark".match(expression)
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment