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 659 posted 13 years ago by webonomic
Hat tip: Allan Odgaard
1 631 posted 15 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 601 posted 16 years ago by Agent
This method generates random (and printable) ascii characters.
1 743 posted 17 years ago by ishikawa
« Prev 1 Next »