/**
 * Validate email address
 * @param   string $email Email address to validate
...

PHP Validate email address

by https://www.google.com/accounts/o8/id?id=AItOawkrlIWZOJFG_JL2F2-39pufYjElslWtCGU, November 11, 2011 21:20, 9 refactorings, tagged with php, regex, script, code, email, textmate
D41d8cd98f00b204e9800998ecf8427e Talk
def parse_query(s)
  if s.count(':') == 0
    return s
...

Ruby Parsing key value with no d...

by theshionak, February 22, 2011 19:21, 9 refactorings, tagged with string, ruby, regex, parse

Input: "the big state:activ...

38ad07c474f260c81ca64a66edfe446e Talk
$css = preg_replace('/\s\s+/', '', preg_replace('@/\\*([\\s\\S]*?)\\*/@','',$css));

PHP Remove Whitespace & Com...

by https://www.google.com/accounts/o8/id?id=AItOawlfLKQUOxClQ5HmGAqM_lnwQLGwjnkD4TI, January 06, 2011 20:34, 4 refactorings, tagged with speed, php, regex

I'm wondering if this is th...

55502f40dc8b7c769880b10874abc9d0 Talk
// Check to make sure value is non-null and matches CSS grammar
// A property may contain more than one class name so we need to
// check each potential class name in the string.
...

Java Validate CSS classnames in ...

by Zack The Human, July 23, 2010 17:08, 2 refactorings, tagged with string, regex, foreach

I have a map of strings whe...

05a80d2c7b26a787f4f1742644f76054 Talk
# Initial attributes Hash
# 
attributes = {
...

Ruby Ruby Hash Extraction Using ...

by notbrain.myopenid.com, February 24, 2010 23:13, 8 refactorings, tagged with rails, ruby, regex, hash, block

I'm looking for a better wa...

55502f40dc8b7c769880b10874abc9d0 Talk
$outputstr =  preg_replace('/[-]{2,}/','-',trim(strtolower(str_replace(' ','-',preg_replace('/[^A-Z0-9- ]+/i','',$inputstr))),'-'));

PHP Trimming excess from string

by paulswansea.myopenid.com, February 05, 2010 16:07, 4 refactorings, tagged with php, regex, replace

I'm trying to get an input ...

E4bd1595f34e7e03765eda6ed65bf6bb Talk
String className = file.getAbsolutePath();

/* TODO, replace this with regex is possible */
...

Java replace with regex

by mikenereson.blogspot.com, August 07, 2009 13:34, 4 refactorings, tagged with regex

Can this be refactored to u...

9db8f865b1d5f3e3978b37e7a3480cc4 Talk
#!/usr/bin/perl

use warnings;
...

Perl A Dvorak keyboard layout cy...

by lordzoner.myopenid.com, August 06, 2009 03:32, 5 refactorings, tagged with regex, cypher

I can't quite get the last ...

D41d8cd98f00b204e9800998ecf8427e Talk
class PropertyGroups
  def self.from_xml(xml)
    document = Document.new(xml)
...

Ruby Ruby text replacement done ...

by Bruno Lopes, July 31, 2009 13:25, 1 refactoring, tagged with ruby, regex

The code is part of a libra...

B42cf6e7f67df424bf43e2c30a939079 Talk
def check_user_agent
    if api_access?
      regex = Regexp.new("^([^/[:space:]]*)(/([^[:space:]]*))?([[:space:]]*\[[a-zA-Z][a-zA-Z]\])?[[:space:]]*(\\((([^()]|(\\([^()]*\\)))*)\\))?[[:space:]]*")
...

Ruby warning: character class ha...

by Jörg, February 16, 2009 01:27, 2 refactorings, tagged with regex, warning

Hola guys.. I am somewhat l...

854e9287641aae13c1045bc7df24bfbf Talk
function formatCurrency(num) {
    num = num.toString().replace(/\\$|\\,/g,'');
    if (isNaN(num)) num = '0';
...

JavaScript Format Currency

by slf, January 20, 2009 20:01, 7 refactorings, tagged with math, regex, formatting

During a code review we fou...

098e5c1a565b47e9860539fbebc3fa98 Talk
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...

Bfca16459c82a7836c3d5c8d79f0b640 Talk
/(?<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
/^(?:(\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 regex, regexp, phone number, regular expression

I wrote this regex for pars...

Aca17ffad5faa4b9f2ea9090b56a1c59 Talk
package ircbot;

/**
...

Java Java IRC Bot

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

I've been working on this f...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
require 'net/http'
require 'uri'
require 'strscan'
...

Ruby Display jpg image url from ...

by Gregory Barborini, January 30, 2008 04:47, 5 refactorings, tagged with image, regex

This code display jpg image...

C1ed5a3bfbb74ac76594077b1db30041 Talk
<?php

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

PHP Wikipedia API and text form...

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

I need to add Wikipedia's i...

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

JavaScript Simple form validator with ...

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

This is a real simple form ...

D41d8cd98f00b204e9800998ecf8427e Talk