1
2
3
def encode
    self[:code] = self[:code].gsub(/\&/, "&amp;").gsub(/\</, "&lt;").gsub(/\>/, "&gt;")
end

Ruby Ruby Html Encode

by codeimpossible, February 14, 2010 03:09, 2 refactorings, tagged with ruby, regular expression

I'm looking for an easier/b...

55997cec217233703cbf68b689578771 Talk
1
2
3
4
<?php
function get_title($html_page)
{
...

PHP Get Title of HTML page

by Nathan, February 09, 2010 14:02, 1 refactoring, tagged with html, title, regular expression

Extract and return the bits...

D5145c421cd25af6fa577c15219add90 Talk
1
2
3
4
def space_out_camel_case(stringAsCamelCase):
    """Adds spaces to a camel case string.  Failure to space out string returns the original string.
    >>> space_out_camel_case('DMLSServicesOtherBSTextLLC')
...

Python CamelCase to Camel Case (Py...

by bigsassy.myopenid.com, December 18, 2008 19:06, 4 refactorings, tagged with short, snippet, camelcase, camel case, re, regular expression

Hi, I'm a python newbie. C...

Cc4c514481dbf2cf9f602188dee3c212 Talk
1
2
3
4
  List<Document> documents = documentLayer.GetDocuments(username);
  List<Document> filteredDocuments = new List<Document>();

...

C# Filterting a List<> w...

by mantis7.myopenid.com, November 25, 2008 16:33, 2 refactorings, tagged with regular expression, C#, List, filter

Have the below code which f...

Avatar Talk
1
2
3
4
/^(?:(\d)[ \-\.]?)?(?:\(?(\d{3})\)?[ \-\.])?(\d{3})[ \-\.](\d{4})(?: ?x?(\d+))?$/

# expanded version w/ comments
...

Ruby Phone number regex

by Lex, October 31, 2008 16:00, 3 refactorings, tagged with phone number, regex, regexp, regular expression

I wrote this regex for pars...

Aca17ffad5faa4b9f2ea9090b56a1c59 Talk