Welcome To Snipplr

Everyone's Recent Ruby Snippets Tagged text

« Prev 1 Next »
This regular expression used in Ruby will extract the characters between single or multi-character delimiters. It helps when you have strange delimiters such as \":delimeter1: text I want to grab goes here :delimiter2:\"
0 554 posted 12 years ago by webonomic
Hat tip: Allan Odgaard
1 530 posted 14 years ago by breakerjump
This is an extension to Ruby's String class. Just put this code in a file and include it. This basically takes a string and adds literals and padding to it. For example, you can format a phone number with optional area code like this: "5445556...
1 468 posted 15 years ago by Agent
This method generates random (and printable) ascii characters.
1 594 posted 16 years ago by ishikawa
« Prev 1 Next »