Cool Ruby regex tricks
In Ruby, regular expressions can be challenging to learn, but they're a powerful tool to parse and manipulate text in your Ruby code. There are plenty of gotchas, but Ruby regex skills will pay dividends if you take the time to practice them. We thought it'd be fun to complement our article about regex conditionals in Ruby by looking at some other neat but uncommon tricks you can do with regexes in Ruby. Some of these tricks are Ruby-specific, but many apply to regular expressions in any language.