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 38 posted 9 years ago by webonomic
Hat tip: Allan Odgaard
1 31 posted 11 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 15 posted 12 years ago by Agent
This method generates random (and printable) ascii characters.
1 19 posted 13 years ago by ishikawa
« Prev 1 Next »