1
category_id = category_name.scan(/category-(\d+)/)[0][0]

Ruby Ugly RegEx Accessor

by sebastian.deutsch.myopenid.com, December 18, 2008 12:39, 9 refactorings, tagged with regex

I try to extract an id from...

Avatar Talk
1
/(?<part>(w(?!ww)|w(?=www)|w(?=[a-z0-9]+ww)|ww(?=[a-z0-9]+w)|www[a-z0-9]+|[a-vx-z0-9])[a-z0-9]*)\.example\.com/

Ruby Shortest regular expression...

by troethom, November 19, 2008 18:48, 3 refactorings, tagged with regex

I have written this regular...

628b75cc5fce9ab14d9e8584a0b3681c 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
1
2
3
4
package ircbot;

/**
...

Java Java IRC Bot

by Ishkur, September 13, 2008 06:04, 4 refactorings, tagged with java, IRC bot, regex

I've been working on this f...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
1
2
3
4
require 'net/http'
require 'uri'
require 'strscan'
...

Ruby Display jpg image url from ...

by gregory.barborini.myopenid.com, January 30, 2008 04:47, 5 refactorings, tagged with image, regex

This code display jpg image...

C1ed5a3bfbb74ac76594077b1db30041 Talk
1
2
3
4
<?php

function fetch($url,$start,$end){
...

PHP Wikipedia API and text form...

by z3ro, January 09, 2008 18:37, 1 refactoring, tagged with wikipedia, api, wikimedia, php, xml, regex, parser, formatting, plain html, html, convert

I need to add Wikipedia's i...

E90ba01aea329491b312280d1eea606b Talk
1
2
3
//function that loops through the elements
function __validateForm(theform){
...

JavaScript Simple form validator with ...

by eljota, November 11, 2007 10:32, 4 refactorings, tagged with js, javascript, form, validation, regex

This is a real simple form ...

Avatar Talk