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 849 posted 14 years ago by webonomic
Hat tip: Allan Odgaard
1 831 posted 16 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 816 posted 17 years ago by Agent
This method generates random (and printable) ascii characters.
1 960 posted 18 years ago by ishikawa
« Prev 1 Next »